-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #65 from drupol/Annotated-plugin-without-doctrine
Doctrine lib and .info file.
- Loading branch information
Showing
29 changed files
with
5,350 additions
and
0 deletions.
There are no files selected for viewing
79 changes: 79 additions & 0 deletions
79
...ontainer_doctrine/lib/Doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
<?php | ||
/* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* This software consists of voluntary contributions made by many individuals | ||
* and is licensed under the MIT license. For more information, see | ||
* <http://www.doctrine-project.org>. | ||
*/ | ||
|
||
namespace Doctrine\Common\Annotations; | ||
|
||
/** | ||
* Annotations class. | ||
* | ||
* @author Benjamin Eberlei <kontakt@beberlei.de> | ||
* @author Guilherme Blanco <guilhermeblanco@hotmail.com> | ||
* @author Jonathan Wage <jonwage@gmail.com> | ||
* @author Roman Borschel <roman@code-factory.org> | ||
*/ | ||
class Annotation | ||
{ | ||
/** | ||
* Value property. Common among all derived classes. | ||
* | ||
* @var string | ||
*/ | ||
public $value; | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param array $data Key-value for properties to be defined in this class. | ||
*/ | ||
public final function __construct(array $data) | ||
{ | ||
foreach ($data as $key => $value) { | ||
$this->$key = $value; | ||
} | ||
} | ||
|
||
/** | ||
* Error handler for unknown property accessor in Annotation class. | ||
* | ||
* @param string $name Unknown property name. | ||
* | ||
* @throws \BadMethodCallException | ||
*/ | ||
public function __get($name) | ||
{ | ||
throw new \BadMethodCallException( | ||
sprintf("Unknown property '%s' on annotation '%s'.", $name, get_class($this)) | ||
); | ||
} | ||
|
||
/** | ||
* Error handler for unknown property mutator in Annotation class. | ||
* | ||
* @param string $name Unknown property name. | ||
* @param mixed $value Property value. | ||
* | ||
* @throws \BadMethodCallException | ||
*/ | ||
public function __set($name, $value) | ||
{ | ||
throw new \BadMethodCallException( | ||
sprintf("Unknown property '%s' on annotation '%s'.", $name, get_class($this)) | ||
); | ||
} | ||
} |
47 changes: 47 additions & 0 deletions
47
...octrine/lib/Doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Attribute.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
/* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* This software consists of voluntary contributions made by many individuals | ||
* and is licensed under the MIT license. For more information, see | ||
* <http://www.doctrine-project.org>. | ||
*/ | ||
|
||
namespace Doctrine\Common\Annotations\Annotation; | ||
|
||
/** | ||
* Annotation that can be used to signal to the parser | ||
* to check the attribute type during the parsing process. | ||
* | ||
* @author Fabio B. Silva <fabio.bat.silva@gmail.com> | ||
* | ||
* @Annotation | ||
*/ | ||
final class Attribute | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
public $name; | ||
|
||
/** | ||
* @var string | ||
*/ | ||
public $type; | ||
|
||
/** | ||
* @var boolean | ||
*/ | ||
public $required = false; | ||
} |
37 changes: 37 additions & 0 deletions
37
...ctrine/lib/Doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Attributes.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
/* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* This software consists of voluntary contributions made by many individuals | ||
* and is licensed under the MIT license. For more information, see | ||
* <http://www.doctrine-project.org>. | ||
*/ | ||
|
||
namespace Doctrine\Common\Annotations\Annotation; | ||
|
||
/** | ||
* Annotation that can be used to signal to the parser | ||
* to check the types of all declared attributes during the parsing process. | ||
* | ||
* @author Fabio B. Silva <fabio.bat.silva@gmail.com> | ||
* | ||
* @Annotation | ||
*/ | ||
final class Attributes | ||
{ | ||
/** | ||
* @var array<Doctrine\Common\Annotations\Annotation\Attribute> | ||
*/ | ||
public $value; | ||
} |
84 changes: 84 additions & 0 deletions
84
...ner_doctrine/lib/Doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Enum.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
<?php | ||
|
||
/* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* This software consists of voluntary contributions made by many individuals | ||
* and is licensed under the MIT license. For more information, see | ||
* <http://www.doctrine-project.org>. | ||
*/ | ||
|
||
namespace Doctrine\Common\Annotations\Annotation; | ||
|
||
/** | ||
* Annotation that can be used to signal to the parser | ||
* to check the available values during the parsing process. | ||
* | ||
* @since 2.4 | ||
* @author Fabio B. Silva <fabio.bat.silva@gmail.com> | ||
* | ||
* @Annotation | ||
* @Attributes({ | ||
* @Attribute("value", required = true, type = "array"), | ||
* @Attribute("literal", required = false, type = "array") | ||
* }) | ||
*/ | ||
final class Enum | ||
{ | ||
/** | ||
* @var array | ||
*/ | ||
public $value; | ||
|
||
/** | ||
* Literal target declaration. | ||
* | ||
* @var array | ||
*/ | ||
public $literal; | ||
|
||
/** | ||
* Annotation constructor. | ||
* | ||
* @param array $values | ||
* | ||
* @throws \InvalidArgumentException | ||
*/ | ||
public function __construct(array $values) | ||
{ | ||
if ( ! isset($values['literal'])) { | ||
$values['literal'] = array(); | ||
} | ||
|
||
foreach ($values['value'] as $var) { | ||
if( ! is_scalar($var)) { | ||
throw new \InvalidArgumentException(sprintf( | ||
'@Enum supports only scalar values "%s" given.', | ||
is_object($var) ? get_class($var) : gettype($var) | ||
)); | ||
} | ||
} | ||
|
||
foreach ($values['literal'] as $key => $var) { | ||
if( ! in_array($key, $values['value'])) { | ||
throw new \InvalidArgumentException(sprintf( | ||
'Undefined enumerator value "%s" for literal "%s".', | ||
$key , $var | ||
)); | ||
} | ||
} | ||
|
||
$this->value = $values['value']; | ||
$this->literal = $values['literal']; | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
.../lib/Doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/IgnoreAnnotation.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
<?php | ||
/* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* This software consists of voluntary contributions made by many individuals | ||
* and is licensed under the MIT license. For more information, see | ||
* <http://www.doctrine-project.org>. | ||
*/ | ||
|
||
namespace Doctrine\Common\Annotations\Annotation; | ||
|
||
/** | ||
* Annotation that can be used to signal to the parser to ignore specific | ||
* annotations during the parsing process. | ||
* | ||
* @Annotation | ||
* @author Johannes M. Schmitt <schmittjoh@gmail.com> | ||
*/ | ||
final class IgnoreAnnotation | ||
{ | ||
/** | ||
* @var array | ||
*/ | ||
public $names; | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param array $values | ||
* | ||
* @throws \RuntimeException | ||
*/ | ||
public function __construct(array $values) | ||
{ | ||
if (is_string($values['value'])) { | ||
$values['value'] = array($values['value']); | ||
} | ||
if (!is_array($values['value'])) { | ||
throw new \RuntimeException(sprintf('@IgnoreAnnotation expects either a string name, or an array of strings, but got %s.', json_encode($values['value']))); | ||
} | ||
|
||
$this->names = $values['value']; | ||
} | ||
} |
33 changes: 33 additions & 0 deletions
33
...doctrine/lib/Doctrine/annotations/lib/Doctrine/Common/Annotations/Annotation/Required.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?php | ||
|
||
/* | ||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, | ||
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | ||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | ||
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
* | ||
* This software consists of voluntary contributions made by many individuals | ||
* and is licensed under the MIT license. For more information, see | ||
* <http://www.doctrine-project.org>. | ||
*/ | ||
|
||
namespace Doctrine\Common\Annotations\Annotation; | ||
|
||
/** | ||
* Annotation that can be used to signal to the parser | ||
* to check if that attribute is required during the parsing process. | ||
* | ||
* @author Fabio B. Silva <fabio.bat.silva@gmail.com> | ||
* | ||
* @Annotation | ||
*/ | ||
final class Required | ||
{ | ||
} |
Oops, something went wrong.