@@ -57,7 +57,7 @@ |
||
57 | 57 | /** |
58 | 58 | * Constructor. |
59 | 59 | * |
60 | - * @param Query|QueryBuilder $query A Doctrine ORM query or query builder. |
|
60 | + * @param Query $query A Doctrine ORM query or query builder. |
|
61 | 61 | * @param boolean $fetchJoinCollection Whether the query joins a collection (true by default). |
62 | 62 | */ |
63 | 63 | public function __construct($query, $fetchJoinCollection = true) |
@@ -1237,7 +1237,7 @@ discard block |
||
1237 | 1237 | /** |
1238 | 1238 | * Schedules an entity for being updated. |
1239 | 1239 | * |
1240 | - * @param object $entity The entity to schedule for being updated. |
|
1240 | + * @param \Shitty\Tests\Models\Forum\ForumUser $entity The entity to schedule for being updated. |
|
1241 | 1241 | * |
1242 | 1242 | * @return void |
1243 | 1243 | * |
@@ -1305,7 +1305,7 @@ discard block |
||
1305 | 1305 | /** |
1306 | 1306 | * Checks whether an entity is registered to be checked in the unit of work. |
1307 | 1307 | * |
1308 | - * @param object $entity |
|
1308 | + * @param \Shitty\Tests\ORM\NotifyChangedEntity $entity |
|
1309 | 1309 | * |
1310 | 1310 | * @return boolean |
1311 | 1311 | */ |
@@ -3121,7 +3121,7 @@ discard block |
||
3121 | 3121 | * |
3122 | 3122 | * @param object $entity The entity that owns the property. |
3123 | 3123 | * @param string $propertyName The name of the property that changed. |
3124 | - * @param mixed $oldValue The old value of the property. |
|
3124 | + * @param null|integer $oldValue The old value of the property. |
|
3125 | 3125 | * @param mixed $newValue The new value of the property. |
3126 | 3126 | * |
3127 | 3127 | * @return void |
@@ -3321,7 +3321,7 @@ discard block |
||
3321 | 3321 | /** |
3322 | 3322 | * Verifies if two given entities actually are the same based on identifier comparison |
3323 | 3323 | * |
3324 | - * @param object $entity1 |
|
3324 | + * @param Proxy $entity1 |
|
3325 | 3325 | * @param object $entity2 |
3326 | 3326 | * |
3327 | 3327 | * @return bool |
@@ -26,7 +26,6 @@ discard block |
||
26 | 26 | use Exception; |
27 | 27 | use InvalidArgumentException; |
28 | 28 | use UnexpectedValueException; |
29 | - |
|
30 | 29 | use Shitty\Common\Collections\ArrayCollection; |
31 | 30 | use Shitty\Common\Collections\Collection; |
32 | 31 | use Shitty\Common\NotifyPropertyChanged; |
@@ -34,14 +33,12 @@ discard block |
||
34 | 33 | use Shitty\Common\Persistence\ObjectManagerAware; |
35 | 34 | use Shitty\ORM\Mapping\ClassMetadata; |
36 | 35 | use Shitty\ORM\Proxy\Proxy; |
37 | - |
|
38 | 36 | use Shitty\ORM\Event\LifecycleEventArgs; |
39 | 37 | use Shitty\ORM\Event\PreUpdateEventArgs; |
40 | 38 | use Shitty\ORM\Event\PreFlushEventArgs; |
41 | 39 | use Shitty\ORM\Event\OnFlushEventArgs; |
42 | 40 | use Shitty\ORM\Event\PostFlushEventArgs; |
43 | 41 | use Shitty\ORM\Event\ListenersInvoker; |
44 | - |
|
45 | 42 | use Shitty\ORM\Cache\Persister\CachedPersister; |
46 | 43 | use Shitty\ORM\Persisters\Entity\BasicEntityPersister; |
47 | 44 | use Shitty\ORM\Persisters\Entity\SingleTablePersister; |
@@ -49,7 +46,6 @@ discard block |
||
49 | 46 | use Shitty\ORM\Persisters\Collection\OneToManyPersister; |
50 | 47 | use Shitty\ORM\Persisters\Collection\ManyToManyPersister; |
51 | 48 | use Shitty\ORM\Utility\IdentifierFlattener; |
52 | -use Shitty\ORM\Cache\AssociationCacheEntry; |
|
53 | 49 | |
54 | 50 | /** |
55 | 51 | * The UnitOfWork is responsible for tracking changes to objects during an |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | $state = $this->getEntityState($entity); |
465 | 465 | |
466 | 466 | if ($state !== self::STATE_MANAGED && $state !== self::STATE_REMOVED) { |
467 | - throw new \InvalidArgumentException("Entity has to be managed or scheduled for removal for single computation " . self::objToStr($entity)); |
|
467 | + throw new \InvalidArgumentException("Entity has to be managed or scheduled for removal for single computation ".self::objToStr($entity)); |
|
468 | 468 | } |
469 | 469 | |
470 | 470 | $class = $this->em->getClassMetadata(get_class($entity)); |
@@ -682,7 +682,7 @@ discard block |
||
682 | 682 | if ($owner === null) { // cloned |
683 | 683 | $actualValue->setOwner($entity, $assoc); |
684 | 684 | } else if ($owner !== $entity) { // no clone, we have to fix |
685 | - if (!$actualValue->isInitialized()) { |
|
685 | + if ( ! $actualValue->isInitialized()) { |
|
686 | 686 | $actualValue->initialize(); // we have to do this otherwise the cols share state |
687 | 687 | } |
688 | 688 | $newValue = clone $actualValue; |
@@ -828,7 +828,7 @@ discard block |
||
828 | 828 | $targetClass = $this->em->getClassMetadata($assoc['targetEntity']); |
829 | 829 | |
830 | 830 | foreach ($unwrappedValue as $key => $entry) { |
831 | - if (! ($entry instanceof $targetClass->name)) { |
|
831 | + if ( ! ($entry instanceof $targetClass->name)) { |
|
832 | 832 | throw ORMInvalidArgumentException::invalidAssociation($targetClass, $assoc, $entry); |
833 | 833 | } |
834 | 834 | |
@@ -1687,7 +1687,7 @@ discard block |
||
1687 | 1687 | throw ORMInvalidArgumentException::detachedEntityCannot($entity, "persisted"); |
1688 | 1688 | |
1689 | 1689 | default: |
1690 | - throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity)); |
|
1690 | + throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity)); |
|
1691 | 1691 | } |
1692 | 1692 | |
1693 | 1693 | $this->cascadePersist($entity, $visited); |
@@ -1757,7 +1757,7 @@ discard block |
||
1757 | 1757 | case self::STATE_DETACHED: |
1758 | 1758 | throw ORMInvalidArgumentException::detachedEntityCannot($entity, "removed"); |
1759 | 1759 | default: |
1760 | - throw new UnexpectedValueException("Unexpected entity state: $entityState." . self::objToStr($entity)); |
|
1760 | + throw new UnexpectedValueException("Unexpected entity state: $entityState.".self::objToStr($entity)); |
|
1761 | 1761 | } |
1762 | 1762 | |
1763 | 1763 | } |
@@ -1908,7 +1908,7 @@ discard block |
||
1908 | 1908 | */ |
1909 | 1909 | private function isLoaded($entity) |
1910 | 1910 | { |
1911 | - return !($entity instanceof Proxy) || $entity->__isInitialized(); |
|
1911 | + return ! ($entity instanceof Proxy) || $entity->__isInitialized(); |
|
1912 | 1912 | } |
1913 | 1913 | |
1914 | 1914 | /** |
@@ -2066,7 +2066,7 @@ discard block |
||
2066 | 2066 | |
2067 | 2067 | $associationMappings = array_filter( |
2068 | 2068 | $class->associationMappings, |
2069 | - function ($assoc) { return $assoc['isCascadeRefresh']; } |
|
2069 | + function($assoc) { return $assoc['isCascadeRefresh']; } |
|
2070 | 2070 | ); |
2071 | 2071 | |
2072 | 2072 | foreach ($associationMappings as $assoc) { |
@@ -2109,7 +2109,7 @@ discard block |
||
2109 | 2109 | |
2110 | 2110 | $associationMappings = array_filter( |
2111 | 2111 | $class->associationMappings, |
2112 | - function ($assoc) { return $assoc['isCascadeDetach']; } |
|
2112 | + function($assoc) { return $assoc['isCascadeDetach']; } |
|
2113 | 2113 | ); |
2114 | 2114 | |
2115 | 2115 | foreach ($associationMappings as $assoc) { |
@@ -2153,7 +2153,7 @@ discard block |
||
2153 | 2153 | |
2154 | 2154 | $associationMappings = array_filter( |
2155 | 2155 | $class->associationMappings, |
2156 | - function ($assoc) { return $assoc['isCascadeMerge']; } |
|
2156 | + function($assoc) { return $assoc['isCascadeMerge']; } |
|
2157 | 2157 | ); |
2158 | 2158 | |
2159 | 2159 | foreach ($associationMappings as $assoc) { |
@@ -2192,7 +2192,7 @@ discard block |
||
2192 | 2192 | |
2193 | 2193 | $associationMappings = array_filter( |
2194 | 2194 | $class->associationMappings, |
2195 | - function ($assoc) { return $assoc['isCascadePersist']; } |
|
2195 | + function($assoc) { return $assoc['isCascadePersist']; } |
|
2196 | 2196 | ); |
2197 | 2197 | |
2198 | 2198 | foreach ($associationMappings as $assoc) { |
@@ -2221,7 +2221,7 @@ discard block |
||
2221 | 2221 | break; |
2222 | 2222 | |
2223 | 2223 | case ($relatedEntities !== null): |
2224 | - if (! $relatedEntities instanceof $assoc['targetEntity']) { |
|
2224 | + if ( ! $relatedEntities instanceof $assoc['targetEntity']) { |
|
2225 | 2225 | throw ORMInvalidArgumentException::invalidAssociation( |
2226 | 2226 | $this->em->getClassMetadata($assoc['targetEntity']), |
2227 | 2227 | $assoc, |
@@ -2252,13 +2252,13 @@ discard block |
||
2252 | 2252 | |
2253 | 2253 | $associationMappings = array_filter( |
2254 | 2254 | $class->associationMappings, |
2255 | - function ($assoc) { return $assoc['isCascadeRemove']; } |
|
2255 | + function($assoc) { return $assoc['isCascadeRemove']; } |
|
2256 | 2256 | ); |
2257 | 2257 | |
2258 | 2258 | $entitiesToCascade = array(); |
2259 | 2259 | |
2260 | 2260 | foreach ($associationMappings as $assoc) { |
2261 | - if ($entity instanceof Proxy && !$entity->__isInitialized__) { |
|
2261 | + if ($entity instanceof Proxy && ! $entity->__isInitialized__) { |
|
2262 | 2262 | $entity->__load(); |
2263 | 2263 | } |
2264 | 2264 | |
@@ -2322,7 +2322,7 @@ discard block |
||
2322 | 2322 | return; |
2323 | 2323 | } |
2324 | 2324 | |
2325 | - if ($entity instanceof Proxy && !$entity->__isInitialized__) { |
|
2325 | + if ($entity instanceof Proxy && ! $entity->__isInitialized__) { |
|
2326 | 2326 | $entity->__load(); |
2327 | 2327 | } |
2328 | 2328 | |
@@ -2337,7 +2337,7 @@ discard block |
||
2337 | 2337 | case LockMode::NONE === $lockMode: |
2338 | 2338 | case LockMode::PESSIMISTIC_READ === $lockMode: |
2339 | 2339 | case LockMode::PESSIMISTIC_WRITE === $lockMode: |
2340 | - if (!$this->em->getConnection()->isTransactionActive()) { |
|
2340 | + if ( ! $this->em->getConnection()->isTransactionActive()) { |
|
2341 | 2341 | throw TransactionRequiredException::transactionRequired(); |
2342 | 2342 | } |
2343 | 2343 | |
@@ -2682,7 +2682,7 @@ discard block |
||
2682 | 2682 | // then we can append this entity for eager loading! |
2683 | 2683 | if ($hints['fetchMode'][$class->name][$field] == ClassMetadata::FETCH_EAGER && |
2684 | 2684 | isset($hints[self::HINT_DEFEREAGERLOAD]) && |
2685 | - !$targetClass->isIdentifierComposite && |
|
2685 | + ! $targetClass->isIdentifierComposite && |
|
2686 | 2686 | $newValue instanceof Proxy && |
2687 | 2687 | $newValue->__isInitialized__ === false) { |
2688 | 2688 | |
@@ -2994,7 +2994,7 @@ discard block |
||
2994 | 2994 | */ |
2995 | 2995 | public function size() |
2996 | 2996 | { |
2997 | - $countArray = array_map(function ($item) { return count($item); }, $this->identityMap); |
|
2997 | + $countArray = array_map(function($item) { return count($item); }, $this->identityMap); |
|
2998 | 2998 | |
2999 | 2999 | return array_sum($countArray); |
3000 | 3000 | } |
@@ -3053,7 +3053,7 @@ discard block |
||
3053 | 3053 | public function getCollectionPersister(array $association) |
3054 | 3054 | { |
3055 | 3055 | $role = isset($association['cache']) |
3056 | - ? $association['sourceEntity'] . '::' . $association['fieldName'] |
|
3056 | + ? $association['sourceEntity'].'::'.$association['fieldName'] |
|
3057 | 3057 | : $association['type']; |
3058 | 3058 | |
3059 | 3059 | if (isset($this->collectionPersisters[$role])) { |
@@ -3271,7 +3271,7 @@ discard block |
||
3271 | 3271 | */ |
3272 | 3272 | private function afterTransactionComplete() |
3273 | 3273 | { |
3274 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
3274 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
3275 | 3275 | $persister->afterTransactionComplete(); |
3276 | 3276 | }); |
3277 | 3277 | } |
@@ -3281,7 +3281,7 @@ discard block |
||
3281 | 3281 | */ |
3282 | 3282 | private function afterTransactionRolledBack() |
3283 | 3283 | { |
3284 | - $this->performCallbackOnCachedPersister(function (CachedPersister $persister) { |
|
3284 | + $this->performCallbackOnCachedPersister(function(CachedPersister $persister) { |
|
3285 | 3285 | $persister->afterTransactionRolledBack(); |
3286 | 3286 | }); |
3287 | 3287 | } |
@@ -3380,7 +3380,7 @@ discard block |
||
3380 | 3380 | if ($other === null) { |
3381 | 3381 | $prop->setValue($managedCopy, null); |
3382 | 3382 | } else { |
3383 | - if ($other instanceof Proxy && !$other->__isInitialized()) { |
|
3383 | + if ($other instanceof Proxy && ! $other->__isInitialized()) { |
|
3384 | 3384 | // do not merge fields marked lazy that have not been fetched. |
3385 | 3385 | continue; |
3386 | 3386 | } |
@@ -38,7 +38,6 @@ |
||
38 | 38 | * Dequeue an exception for a specific method invocation |
39 | 39 | * |
40 | 40 | * @param string $method |
41 | - * @param mixed $default |
|
42 | 41 | * |
43 | 42 | * @return mixed |
44 | 43 | */ |
@@ -34,7 +34,7 @@ |
||
34 | 34 | |
35 | 35 | /** |
36 | 36 | * @param array $params |
37 | - * @param \Shitty\DBAL\Driver $driver |
|
37 | + * @param DriverMock $driver |
|
38 | 38 | * @param \Shitty\DBAL\Configuration|null $config |
39 | 39 | * @param \Shitty\Common\EventManager|null $eventManager |
40 | 40 | */ |
@@ -90,6 +90,9 @@ |
||
90 | 90 | return $this->name; |
91 | 91 | } |
92 | 92 | |
93 | + /** |
|
94 | + * @param string $name |
|
95 | + */ |
|
93 | 96 | public function setName($name) |
94 | 97 | { |
95 | 98 | $this->name = $name; |
@@ -51,6 +51,9 @@ |
||
51 | 51 | */ |
52 | 52 | public $complexAction; |
53 | 53 | |
54 | + /** |
|
55 | + * @param string $token |
|
56 | + */ |
|
54 | 57 | public function __construct($token, Client $client = null) |
55 | 58 | { |
56 | 59 | $this->logins = new ArrayCollection(); |
@@ -19,6 +19,9 @@ |
||
19 | 19 | */ |
20 | 20 | private $brand; |
21 | 21 | |
22 | + /** |
|
23 | + * @param string $brand |
|
24 | + */ |
|
22 | 25 | public function __construct($brand = null) { |
23 | 26 | $this->brand = $brand; |
24 | 27 | } |
@@ -79,6 +79,9 @@ discard block |
||
79 | 79 | return $this->hoursWorked; |
80 | 80 | } |
81 | 81 | |
82 | + /** |
|
83 | + * @param integer $hoursWorked |
|
84 | + */ |
|
82 | 85 | public function setHoursWorked($hoursWorked) |
83 | 86 | { |
84 | 87 | $this->hoursWorked = $hoursWorked; |
@@ -89,6 +92,9 @@ discard block |
||
89 | 92 | return $this->pricePerHour; |
90 | 93 | } |
91 | 94 | |
95 | + /** |
|
96 | + * @param integer $pricePerHour |
|
97 | + */ |
|
92 | 98 | public function setPricePerHour($pricePerHour) |
93 | 99 | { |
94 | 100 | $this->pricePerHour = $pricePerHour; |
@@ -33,6 +33,9 @@ discard block |
||
33 | 33 | */ |
34 | 34 | private $links; |
35 | 35 | |
36 | + /** |
|
37 | + * @param string $title |
|
38 | + */ |
|
36 | 39 | public function __construct($title) |
37 | 40 | { |
38 | 41 | $this->title = $title; |
@@ -60,6 +63,10 @@ discard block |
||
60 | 63 | return $this->references; |
61 | 64 | } |
62 | 65 | |
66 | + /** |
|
67 | + * @param string $language |
|
68 | + * @param string $title |
|
69 | + */ |
|
63 | 70 | public function addTranslation($language, $title) |
64 | 71 | { |
65 | 72 | $this->translations[] = new DDC117Translation($this, $language, $title); |