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
- question : "In which PHP version can I typehint a Object using the 'object' keyword ?" | |
answers : | |
- OK 7.2 | |
- KO 7.0 | |
- KO 7.1 | |
- none of above | |
- KO 5.6 | |
component : PHP | |
extra_link : http://php.net/manual/en/migration72.new-features.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
<?php | |
use Doctrine\ORM\Mapping as ORM; | |
use Doctrine\Common\Collections\ArrayCollection; | |
/** | |
* @ORM\Entity() | |
* @ORM\Table(name="user") | |
*/ | |
class User |
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
st = status | |
co = checkout | |
cob = checkout --no-track -b | |
cp = cherry-pick | |
rb = rebase | |
rbom = rebase origin/master | |
rbi = rebase -i | |
rbiom = rebase -i origin/master | |
c = commit | |
ca = commit --amend |
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
<?php | |
// src/Form/EditUserType.php | |
class EditUserType extends AbstractType | |
{ | |
public function buildForm(FormBuilderInterface $builder, array $options) | |
{ | |
$builder | |
->add('email', EmailType::class) | |
->add('password', RepeatedType::class, [ | |
'type' => PasswordType::class, |
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
<?php | |
final class FilterEagerLoadingExtension | |
{ | |
// ... | |
private function getQueryBuilderWithNewAliases(QueryBuilder $queryBuilder,QueryNameGeneratorInterface $queryNameGenerator,string $originAlias = 'o', string $replacement = 'o_2') | |
{ | |
// ... | |
// Change join aliases | |
foreach ($joinParts[$originAlias] as $joinPart) { | |
/** @var Join $joinPart */ |
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
<?php | |
class CollectionDataProvider implements ContextAwareCollectionDataProviderInterface, RestrictedDataProviderInterface | |
{ | |
private $managerRegistry; | |
private $collectionExtensions; | |
private $requestStack; | |
private $serializer; | |
/** |
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
<?php | |
namespace App\Validator; | |
use Symfony\Component\Validator\Constraint; | |
/** | |
* @Annotation | |
*/ | |
class Role extends Constraint |
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
<?php | |
namespace App\Validator; | |
use Symfony\Component\Validator\Constraint; | |
/** | |
* @Annotation | |
*/ | |
class Role extends Constraint |
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
<?php | |
namespace App\Validator; | |
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface; | |
use Symfony\Component\Validator\Constraint; | |
use Symfony\Component\Validator\ConstraintValidator; | |
class RoleValidator extends ConstraintValidator | |
{ |
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
<?php | |
namespace App\Entity; | |
use Doctrine\ORM\Mapping as ORM; | |
use ApiPlatform\Core\Annotation\ApiResource; | |
use App\Validator as CustomValidator; | |
/** | |
* @ORM\Entity(repositoryClass="App\Repository\PostRepository") | |
* @ApiResource( |
OlderNewer