Skip to content

Commit

Permalink
Merge branch 'symfony:main' into bugfix/yaml-source-manipulator-key-r…
Browse files Browse the repository at this point in the history
…egex
  • Loading branch information
lubo13 authored Sep 13, 2021
2 parents e0cbcc6 + 85797f6 commit e854ce9
Show file tree
Hide file tree
Showing 63 changed files with 736 additions and 404 deletions.
1 change: 0 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ on:
env:
PHPUNIT_FLAGS: "-v"
SYMFONY_PHPUNIT_DIR: "$HOME/symfony-bridge/.phpunit"
SYMFONY_REQUIRE: ">=4.0"

jobs:
coding-standards:
Expand Down
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# Changelog

## [v1.33.0](https://github.com/symfony/maker-bundle/releases/tag/v1.33.0)

*June 30th, 2021*

### Feature

- [#895](https://github.com/symfony/maker-bundle/pull/895) - [make:crud] send the proper HTTP status codes and use renderForm() when available - *@dunglas*
- [#889](https://github.com/symfony/maker-bundle/pull/889) - [make:user] Use password_hashers instead of encoders - *@wouterj*

### Bug Fix

- [#913](https://github.com/symfony/maker-bundle/pull/913) - [make:registration] conditionally generate verify email flash in template - *@jrushlow*
- [#881](https://github.com/symfony/maker-bundle/pull/881) - [make:entity] Fix error when API-Platform is installed. - *@MichaelBrauner*

## [v1.32.0](https://github.com/symfony/maker-bundle/releases/tag/v1.32.0)

*June 18th, 2021*
Expand Down
1 change: 1 addition & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ init:
- SET PHP=0 # This var is connected to PHP install cache
- SET ANSICON=121x90 (121x90)
- SET MAKER_DISABLE_FILE_LINKS=1
- SET MAKER_SKIP_MERCURE_TEST=1

environment:
TEST_DATABASE_DSN: mysql://root:Password12!@127.0.0.1:3306/test_maker
Expand Down
10 changes: 5 additions & 5 deletions src/Command/MakerCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ public function __construct(MakerInterface $maker, FileManager $fileManager, Gen
parent::__construct();
}

protected function configure()
protected function configure(): void
{
$this->maker->configureCommand($this, $this->inputConfig);
}

protected function initialize(InputInterface $input, OutputInterface $output)
protected function initialize(InputInterface $input, OutputInterface $output): void
{
$this->io = new ConsoleStyle($input, $output);
$this->fileManager->setIO($this->io);
Expand All @@ -74,7 +74,7 @@ protected function initialize(InputInterface $input, OutputInterface $output)
}
}

protected function interact(InputInterface $input, OutputInterface $output)
protected function interact(InputInterface $input, OutputInterface $output): void
{
if (!$this->fileManager->isNamespaceConfiguredToAutoload($this->generator->getRootNamespace())) {
$this->io->note([
Expand Down Expand Up @@ -111,7 +111,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
return 0;
}

public function setApplication(Application $application = null)
public function setApplication(Application $application = null): void
{
parent::setApplication($application);

Expand All @@ -127,7 +127,7 @@ public function setApplication(Application $application = null)
/**
* @internal Used for testing commands
*/
public function setCheckDependencies(bool $checkDeps)
public function setCheckDependencies(bool $checkDeps): void
{
$this->checkDependencies = $checkDeps;
}
Expand Down
4 changes: 2 additions & 2 deletions src/ConsoleStyle.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ public function __construct(InputInterface $input, OutputInterface $output)
parent::__construct($input, $output);
}

public function success($message)
public function success($message): void
{
$this->writeln('<fg=green;options=bold,underscore>OK</> '.$message);
}

public function comment($message)
public function comment($message): void
{
$this->text($message);
}
Expand Down
4 changes: 2 additions & 2 deletions src/DependencyBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ final class DependencyBuilder
* the user if other required dependencies are missing. An example
* is the "validator" when trying to work with forms.
*/
public function addClassDependency(string $class, string $package, bool $required = true, bool $devDependency = false)
public function addClassDependency(string $class, string $package, bool $required = true, bool $devDependency = false): void
{
if ($devDependency) {
$this->devDependencies[] = [
Expand All @@ -42,7 +42,7 @@ public function addClassDependency(string $class, string $package, bool $require
}
}

public function requirePHP71()
public function requirePHP71(): void
{
// no-op - MakerBundle now required PHP 7.1
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class MakeCommandRegistrationPass implements CompilerPassInterface
{
public const MAKER_TAG = 'maker.command';

public function process(ContainerBuilder $container)
public function process(ContainerBuilder $container): void
{
foreach ($container->findTaggedServiceIds(self::MAKER_TAG) as $id => $tags) {
$def = $container->getDefinition($id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*/
class RemoveMissingParametersPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container)
public function process(ContainerBuilder $container): void
{
if (!$container->hasParameter('twig.default_path')) {
$container->getDefinition('maker.file_manager')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

class SetDoctrineAnnotatedPrefixesPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container)
public function process(ContainerBuilder $container): void
{
$annotatedPrefixes = null;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
*/
class SetDoctrineManagerRegistryClassPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container)
public function process(ContainerBuilder $container): void
{
if ($container->hasAlias(ManagerRegistry::class)) {
$definition = $container->getDefinition('maker.entity_class_generator');
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Configuration implements ConfigurationInterface
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder()
public function getConfigTreeBuilder(): TreeBuilder
{
$treeBuilder = new TreeBuilder('maker');
if (method_exists($treeBuilder, 'getRootNode')) {
Expand Down
2 changes: 1 addition & 1 deletion src/DependencyInjection/MakerExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class MakerExtension extends Extension
/**
* {@inheritdoc}
*/
public function load(array $configs, ContainerBuilder $container)
public function load(array $configs, ContainerBuilder $container): void
{
$loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load('services.xml');
Expand Down
18 changes: 9 additions & 9 deletions src/Doctrine/BaseRelation.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,36 +26,36 @@ abstract class BaseRelation

abstract public function isOwning(): bool;

public function getPropertyName()
public function getPropertyName(): string
{
return $this->propertyName;
}

public function setPropertyName($propertyName)
public function setPropertyName(string $propertyName): self
{
$this->propertyName = $propertyName;

return $this;
}

public function getTargetClassName()
public function getTargetClassName(): string
{
return $this->targetClassName;
}

public function setTargetClassName($targetClassName)
public function setTargetClassName(string $targetClassName): self
{
$this->targetClassName = $targetClassName;

return $this;
}

public function getTargetPropertyName()
public function getTargetPropertyName(): ?string
{
return $this->targetPropertyName;
}

public function setTargetPropertyName($targetPropertyName)
public function setTargetPropertyName(?string $targetPropertyName): self
{
$this->targetPropertyName = $targetPropertyName;

Expand All @@ -67,7 +67,7 @@ public function isSelfReferencing(): bool
return $this->isSelfReferencing;
}

public function setIsSelfReferencing(bool $isSelfReferencing)
public function setIsSelfReferencing(bool $isSelfReferencing): self
{
$this->isSelfReferencing = $isSelfReferencing;

Expand All @@ -79,7 +79,7 @@ public function getMapInverseRelation(): bool
return $this->mapInverseRelation;
}

public function setMapInverseRelation(bool $mapInverseRelation)
public function setMapInverseRelation(bool $mapInverseRelation): self
{
$this->mapInverseRelation = $mapInverseRelation;

Expand All @@ -91,7 +91,7 @@ public function shouldAvoidSetter(): bool
return $this->avoidSetter;
}

public function avoidSetter(bool $avoidSetter = true)
public function avoidSetter(bool $avoidSetter = true): self
{
$this->avoidSetter = $avoidSetter;

Expand Down
2 changes: 1 addition & 1 deletion src/Doctrine/BaseSingleRelation.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function isNullable(): bool
return false;
}

public function setIsNullable($isNullable)
public function setIsNullable(bool $isNullable): self
{
$this->isNullable = $isNullable;

Expand Down
5 changes: 1 addition & 4 deletions src/Doctrine/DoctrineHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,7 @@ public function getMetadata(string $classOrNamespace = null, bool $disconnected
return $metadata;
}

/**
* @return EntityDetails|null
*/
public function createDoctrineDetails(string $entityClassName)
public function createDoctrineDetails(string $entityClassName): ?EntityDetails
{
$metadata = $this->getMetadata($entityClassName);

Expand Down
6 changes: 3 additions & 3 deletions src/Doctrine/EntityDetails.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function __construct($metadata)
$this->metadata = $metadata;
}

public function getRepositoryClass()
public function getRepositoryClass(): ?string
{
return $this->metadata->customRepositoryClassName;
}
Expand All @@ -41,12 +41,12 @@ public function getIdentifier()
return $this->metadata->identifier[0];
}

public function getDisplayFields()
public function getDisplayFields(): array
{
return $this->metadata->fieldMappings;
}

public function getFormFields()
public function getFormFields(): array
{
$fields = (array) $this->metadata->fieldNames;
// Remove the primary key field if it's not managed manually
Expand Down
8 changes: 4 additions & 4 deletions src/Doctrine/EntityRegenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,11 @@ public function __construct(DoctrineHelper $doctrineHelper, FileManager $fileMan
$this->overwrite = $overwrite;
}

public function regenerateEntities(string $classOrNamespace)
public function regenerateEntities(string $classOrNamespace): void
{
try {
$metadata = $this->doctrineHelper->getMetadata($classOrNamespace);
} catch (MappingException | LegacyCommonMappingException | PersistenceMappingException $mappingException) {
} catch (MappingException|LegacyCommonMappingException|PersistenceMappingException $mappingException) {
$metadata = $this->doctrineHelper->getMetadata($classOrNamespace, true);
}

Expand Down Expand Up @@ -215,7 +215,7 @@ private function getPathOfClass(string $class): string
return (new \ReflectionClass($class))->getFileName();
}

private function generateRepository(ClassMetadata $metadata)
private function generateRepository(ClassMetadata $metadata): void
{
if (!$metadata->customRepositoryClassName) {
return;
Expand All @@ -235,7 +235,7 @@ private function generateRepository(ClassMetadata $metadata)
$this->generator->writeChanges();
}

private function getMappedFieldsInEntity(ClassMetadata $classMetadata)
private function getMappedFieldsInEntity(ClassMetadata $classMetadata): array
{
/* @var $classReflection \ReflectionClass */
$classReflection = $classMetadata->reflClass;
Expand Down
8 changes: 4 additions & 4 deletions src/Doctrine/EntityRelation.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,12 @@ public function __construct(string $type, string $owningClass, string $inverseCl
$this->isSelfReferencing = $owningClass === $inverseClass;
}

public function setOwningProperty(string $owningProperty)
public function setOwningProperty(string $owningProperty): void
{
$this->owningProperty = $owningProperty;
}

public function setInverseProperty(string $inverseProperty)
public function setInverseProperty(string $inverseProperty): void
{
if (!$this->mapInverseRelation) {
throw new \Exception('Cannot call setInverseProperty() when the inverse relation will not be mapped.');
Expand All @@ -69,12 +69,12 @@ public function setInverseProperty(string $inverseProperty)
$this->inverseProperty = $inverseProperty;
}

public function setIsNullable(bool $isNullable)
public function setIsNullable(bool $isNullable): void
{
$this->isNullable = $isNullable;
}

public function setOrphanRemoval(bool $orphanRemoval)
public function setOrphanRemoval(bool $orphanRemoval): void
{
$this->orphanRemoval = $orphanRemoval;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Doctrine/ORMDependencyBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ final class ORMDependencyBuilder
/**
* Central method to add dependencies needed for Doctrine ORM.
*/
public static function buildDependencies(DependencyBuilder $dependencies)
public static function buildDependencies(DependencyBuilder $dependencies): void
{
$classes = [
// guarantee DoctrineBundle
Expand Down
2 changes: 1 addition & 1 deletion src/Doctrine/RelationManyToMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function isOwning(): bool
return $this->isOwning;
}

public function setIsOwning($isOwning)
public function setIsOwning($isOwning): self
{
$this->isOwning = $isOwning;

Expand Down
2 changes: 1 addition & 1 deletion src/Doctrine/RelationOneToMany.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function getOrphanRemoval(): bool
return $this->orphanRemoval;
}

public function setOrphanRemoval($orphanRemoval)
public function setOrphanRemoval($orphanRemoval): self
{
$this->orphanRemoval = $orphanRemoval;

Expand Down
6 changes: 3 additions & 3 deletions src/Doctrine/RelationOneToOne.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ public function isOwning(): bool
return $this->isOwning;
}

public function setIsOwning($isOwning)
public function setIsOwning($isOwning): self
{
$this->isOwning = $isOwning;

return $this;
}

public function getTargetGetterMethodName()
public function getTargetGetterMethodName(): string
{
return 'get'.Str::asCamelCase($this->getTargetPropertyName());
}

public function getTargetSetterMethodName()
public function getTargetSetterMethodName(): string
{
return 'set'.Str::asCamelCase($this->getTargetPropertyName());
}
Expand Down
Loading

0 comments on commit e854ce9

Please sign in to comment.