Vendor update && Started using DoctrineMigrations

This commit is contained in:
Polonkai Gergely
2012-07-23 17:09:03 +02:00
parent 7c36f93436
commit bf46316347
1102 changed files with 103189 additions and 7 deletions

View File

@@ -0,0 +1,13 @@
<?php
namespace JMS\DiExtraBundle\Annotation;
/**
* @Annotation
* @Target("METHOD")
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
final class AfterSetup
{
}

View File

@@ -0,0 +1,74 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace JMS\DiExtraBundle\Annotation;
use JMS\DiExtraBundle\Exception\InvalidTypeException;
/**
* @Annotation
* @Target("CLASS")
*/
class DoctrineListener
{
/** @var array<string> @Required */
public $events;
/** @var string */
public $connection;
/** @var boolean */
public $lazy = true;
/** @var integer */
public $priority = 0;
public function __construct()
{
if (0 === func_num_args()) {
return;
}
$values = func_get_arg(0);
if (!isset($values['value'])) {
throw new InvalidTypeException('DoctrineListener', 'value', 'array or string', null);
}
$this->events = (array) $values['value'];
if (isset($values['connection'])) {
if (!is_string($values['connection'])) {
throw new InvalidTypeException('DoctrineListener', 'connection', 'string', $values['connection']);
}
$this->connection = $values['connection'];
}
if (isset($values['lazy'])) {
if (!is_boolean($values['lazy'])) {
throw new InvalidTypeException('DoctrineListener', 'lazy', 'boolean', $values['lazy']);
}
$this->lazy = $values['lazy'];
}
if (isset($values['priority'])) {
if (!is_integer($values['priority'])) {
throw new InvalidTypeException('DoctrineListener', 'priority', 'integer', $values['priority']);
}
$this->priority = $values['priority'];
}
}
}

View File

@@ -0,0 +1,37 @@
<?php
namespace JMS\DiExtraBundle\Annotation;
use JMS\DiExtraBundle\Exception\InvalidTypeException;
/**
* @Annotation
* @Target("CLASS")
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
final class FormType
{
/** @var string */
public $alias;
public function __construct()
{
if (0 === func_num_args()) {
return;
}
$values = func_get_arg(0);
if (isset($values['value'])) {
$values['alias'] = $values['value'];
}
if (isset($values['alias'])) {
if (!is_string($values['alias'])) {
throw new InvalidTypeException('FormType', 'alias', 'string', $values['alias']);
}
$this->alias = $values['alias'];
}
}
}

View File

@@ -0,0 +1,27 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace JMS\DiExtraBundle\Annotation;
/**
* @Annotation
* @Target({"PROPERTY", "ANNOTATION"})
*/
final class Inject extends Reference
{
}

View File

@@ -0,0 +1,57 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace JMS\DiExtraBundle\Annotation;
use JMS\DiExtraBundle\Exception\InvalidTypeException;
/**
* @Annotation
* @Target("METHOD")
*/
final class InjectParams
{
/** @var array<JMS\DiExtraBundle\Annotation\Inject> */
public $params = array();
public function __construct()
{
if (0 === func_num_args()) {
return;
}
$values = func_get_arg(0);
if (isset($values['params'])) {
$values['value'] = $values['params'];
}
if (isset($values['value'])) {
if (!is_array($values['value'])) {
throw new InvalidTypeException('InjectParams', 'value', 'array', $values['value']);
}
foreach ($values['value'] as $k => $v) {
if (!$v instanceof Inject) {
throw new InvalidTypeException('InjectParams', sprintf('value[%s]', $k), '@Inject', $v);
}
$this->params[$k] = $v;
}
}
}
}

View File

@@ -0,0 +1,27 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace JMS\DiExtraBundle\Annotation;
/**
* @Annotation
* @Target("METHOD")
*/
final class LookupMethod extends Reference
{
}

View File

@@ -0,0 +1,62 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace JMS\DiExtraBundle\Annotation;
use JMS\DiExtraBundle\Exception\InvalidTypeException;
/**
* @Annotation
* @Target("METHOD")
*/
final class Observe
{
/** @var string @Required */
public $event;
/** @var integer */
public $priority = 0;
public function __construct()
{
if (0 === func_num_args()) {
return;
}
$values = func_get_arg(0);
if (isset($values['event'])) {
$values['value'] = $values['event'];
}
if (isset($values['value'])) {
if (!is_string($values['value'])) {
throw new InvalidTypeException('Observe', 'value', 'string', $values['value']);
}
$this->event = $values['value'];
}
if (isset($values['priority'])) {
if (!is_numeric($values['priority'])) {
throw new InvalidTypeException('Observe', 'priority', 'integer', $values['priority']);
}
$this->priority = $values['priority'];
}
}
}

View File

@@ -0,0 +1,54 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace JMS\DiExtraBundle\Annotation;
use JMS\DiExtraBundle\Exception\InvalidTypeException;
abstract class Reference
{
/** @var string */
public $value;
/** @var boolean */
public $required;
public final function __construct()
{
if (0 === func_num_args()) {
return;
}
$values = func_get_arg(0);
if (isset($values['value'])) {
if (!is_string($values['value'])) {
throw new InvalidTypeException('Inject', 'value', 'string', $values['value']);
}
$this->value = $values['value'];
}
if (isset($values['required'])) {
if (!is_bool($values['required'])) {
throw new InvalidTypeException('Inject', 'required', 'boolean', $values['required']);
}
$this->required = $values['required'];
}
}
}

View File

@@ -0,0 +1,87 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace JMS\DiExtraBundle\Annotation;
use JMS\DiExtraBundle\Exception\InvalidTypeException;
/**
* @Annotation
* @Target("CLASS")
*/
final class Service
{
/** @var string */
public $id;
/** @var string */
public $parent;
/** @var boolean */
public $public;
/** @var string */
public $scope;
/** @var boolean */
public $abstract;
public function __construct()
{
if (0 === func_num_args()) {
return;
}
$values = func_get_arg(0);
if (isset($values['value'])) {
if (!is_string($values['value'])) {
throw new InvalidTypeException('Service', 'value', 'string', $values['value']);
}
$this->id = $values['value'];
}
if (isset($values['parent'])) {
if (!is_string($values['parent'])) {
throw new InvalidTypeException('Service', 'parent', 'string', $values['parent']);
}
$this->parent = $values['parent'];
}
if (isset($values['public'])) {
if (!is_bool($values['public'])) {
throw new InvalidTypeException('Service', 'public', 'boolean', $values['public']);
}
$this->public = $values['public'];
}
if (isset($values['scope'])) {
if (!is_string($values['scope'])) {
throw new InvalidTypeException('Service', 'scope', 'string', $values['scope']);
}
$this->scope = $values['scope'];
}
if (isset($values['abstract'])) {
if (!is_bool($values['abstract'])) {
throw new InvalidTypeException('Service', 'abstract', 'boolean', $values['abstract']);
}
$this->abstract = $values['abstract'];
}
}
}

View File

@@ -0,0 +1,60 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace JMS\DiExtraBundle\Annotation;
use JMS\DiExtraBundle\Exception\InvalidArgumentException;
use JMS\DiExtraBundle\Exception\InvalidTypeException;
/**
* @Annotation
* @Target("CLASS")
*/
final class Tag
{
/** @var string @Required */
public $name;
/** @var array */
public $attributes = array();
public function __construct()
{
if (0 === func_num_args()) {
return;
}
$values = func_get_arg(0);
if (!isset($values['value'])) {
throw new InvalidArgumentException('A value must be given for annotation "@Tag".');
}
if (!is_string($values['value'])) {
throw new InvalidTypeException('Tag', 'value', 'string', $values['value']);
}
$this->name = $values['value'];
if (isset($values['attributes'])) {
if (!is_array($values['attributes'])) {
throw new InvalidTypeException('Tag', 'attributes', 'array', $values['attributes']);
}
$this->attributes = $values['attributes'];
}
}
}

View File

@@ -0,0 +1,51 @@
<?php
/*
* Copyright 2011 Johannes M. Schmitt <schmittjoh@gmail.com>
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
namespace JMS\DiExtraBundle\Annotation;
use JMS\DiExtraBundle\Exception\InvalidTypeException;
/**
* @Annotation
* @Target("CLASS")
*/
final class Validator
{
/** @var string @Required */
public $alias;
public function __construct()
{
if (0 === func_num_args()) {
return;
}
$values = func_get_arg(0);
if (isset($values['alias'])) {
$values['value'] = $values['alias'];
}
if (!isset($values['value'])) {
throw new \InvalidArgumentException('A value must be given for @Validator annotations.');
}
if (!is_string($values['value'])) {
throw new InvalidTypeException('Validator', 'value', 'string', $values['value']);
}
$this->alias = $values['value'];
}
}