Skip to content
This repository has been archived by the owner on Oct 1, 2021. It is now read-only.

Commit

Permalink
Fixed wrong or missing PHPDoc (#81)
Browse files Browse the repository at this point in the history
  • Loading branch information
core23 authored and greg0ire committed Jun 3, 2016
1 parent c4f3fd4 commit 0f615f4
Show file tree
Hide file tree
Showing 19 changed files with 283 additions and 17 deletions.
27 changes: 27 additions & 0 deletions Bundle/BundleMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,44 @@

class BundleMetadata
{
/**
* @var BundleInterface
*/
protected $bundle;

/**
* @var string|bool
*/
protected $vendor = false;

/**
* @var bool
*/
protected $valid = false;

/**
* @var string
*/
protected $namespace;

/**
* @var string
*/
protected $name;

/**
* @var bool
*/
protected $extendedDirectory = false;

/**
* @var bool
*/
protected $extendedNamespace = false;

/**
* @var array
*/
protected $configuration = array();

/**
Expand Down Expand Up @@ -58,6 +82,9 @@ public function __construct(BundleInterface $bundle, array $configuration = arra
$this->buildInformation();
}

/**
* @return bool
*/
public function isExtendable()
{
// does not extends Application bundle ...
Expand Down
46 changes: 46 additions & 0 deletions Bundle/OdmMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,34 @@

class OdmMetadata
{
/**
* @var string
*/
protected $mappingDocumentDirectory;

/**
* @var string
*/
protected $extendedMappingDocumentDirectory;

/**
* @var string
*/
protected $documentDirectory;

/**
* @var string
*/
protected $extendedDocumentDirectory;

/**
* @var string
*/
protected $extendedSerializerDirectory;

/**
* @param BundleMetadata $bundleMetadata
*/
public function __construct(BundleMetadata $bundleMetadata)
{
$this->mappingDocumentDirectory = sprintf('%s/Resources/config/doctrine/', $bundleMetadata->getBundle()->getPath());
Expand All @@ -30,31 +52,49 @@ public function __construct(BundleMetadata $bundleMetadata)
$this->extendedSerializerDirectory = sprintf('%s/Resources/config/serializer', $bundleMetadata->getExtendedDirectory());
}

/**
* @return string
*/
public function getMappingDocumentDirectory()
{
return $this->mappingDocumentDirectory;
}

/**
* @return string
*/
public function getExtendedMappingDocumentDirectory()
{
return $this->extendedMappingDocumentDirectory;
}

/**
* @return string
*/
public function getDocumentDirectory()
{
return $this->documentDirectory;
}

/**
* @return string
*/
public function getExtendedDocumentDirectory()
{
return $this->extendedDocumentDirectory;
}

/**
* @return string
*/
public function getExtendedSerializerDirectory()
{
return $this->extendedSerializerDirectory;
}

/**
* @return array|\Iterator
*/
public function getDocumentMappingFiles()
{
try {
Expand All @@ -68,6 +108,9 @@ public function getDocumentMappingFiles()
}
}

/**
* @return array
*/
public function getDocumentNames()
{
$names = array();
Expand All @@ -87,6 +130,9 @@ public function getDocumentNames()
return $names;
}

/**
* @return array|\Iterator
*/
public function getRepositoryFiles()
{
try {
Expand Down
46 changes: 46 additions & 0 deletions Bundle/OrmMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,34 @@

class OrmMetadata
{
/**
* @var string
*/
protected $mappingEntityDirectory;

/**
* @var string
*/
protected $extendedMappingEntityDirectory;

/**
* @var string
*/
protected $entityDirectory;

/**
* @var string
*/
protected $extendedEntityDirectory;

/**
* @var string
*/
protected $extendedSerializerDirectory;

/**
* @param BundleMetadata $bundleMetadata
*/
public function __construct(BundleMetadata $bundleMetadata)
{
$this->mappingEntityDirectory = sprintf('%s/Resources/config/doctrine/', $bundleMetadata->getBundle()->getPath());
Expand All @@ -30,31 +52,49 @@ public function __construct(BundleMetadata $bundleMetadata)
$this->extendedSerializerDirectory = sprintf('%s/Resources/config/serializer', $bundleMetadata->getExtendedDirectory());
}

/**
* @return string
*/
public function getMappingEntityDirectory()
{
return $this->mappingEntityDirectory;
}

/**
* @return string
*/
public function getExtendedMappingEntityDirectory()
{
return $this->extendedMappingEntityDirectory;
}

/**
* @return string
*/
public function getEntityDirectory()
{
return $this->entityDirectory;
}

/**
* @return string
*/
public function getExtendedEntityDirectory()
{
return $this->extendedEntityDirectory;
}

/**
* @return string
*/
public function getExtendedSerializerDirectory()
{
return $this->extendedSerializerDirectory;
}

/**
* @return array|\Iterator
*/
public function getEntityMappingFiles()
{
try {
Expand All @@ -69,6 +109,9 @@ public function getEntityMappingFiles()
}
}

/**
* @return array
*/
public function getEntityNames()
{
$names = array();
Expand All @@ -89,6 +132,9 @@ public function getEntityNames()
return $names;
}

/**
* @return array|\Iterator
*/
public function getRepositoryFiles()
{
try {
Expand Down
46 changes: 46 additions & 0 deletions Bundle/PhpcrMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,34 @@

class PhpcrMetadata
{
/**
* @var string
*/
protected $mappingDocumentDirectory;

/**
* @var string
*/
protected $extendedMappingDocumentDirectory;

/**
* @var string
*/
protected $documentDirectory;

/**
* @var string
*/
protected $extendedDocumentDirectory;

/**
* @var string
*/
protected $extendedSerializerDirectory;

/**
* @param BundleMetadata $bundleMetadata
*/
public function __construct(BundleMetadata $bundleMetadata)
{
$this->mappingDocumentDirectory = sprintf('%s/Resources/config/doctrine/', $bundleMetadata->getBundle()->getPath());
Expand All @@ -30,31 +52,49 @@ public function __construct(BundleMetadata $bundleMetadata)
$this->extendedSerializerDirectory = sprintf('%s/Resources/config/serializer', $bundleMetadata->getExtendedDirectory());
}

/**
* @return string
*/
public function getMappingDocumentDirectory()
{
return $this->mappingDocumentDirectory;
}

/**
* @return string
*/
public function getExtendedMappingDocumentDirectory()
{
return $this->extendedMappingDocumentDirectory;
}

/**
* @return string
*/
public function getDocumentDirectory()
{
return $this->documentDirectory;
}

/**
* @return string
*/
public function getExtendedDocumentDirectory()
{
return $this->extendedDocumentDirectory;
}

/**
* @return string
*/
public function getExtendedSerializerDirectory()
{
return $this->extendedSerializerDirectory;
}

/**
* @return array|\Iterator
*/
public function getDocumentMappingFiles()
{
try {
Expand All @@ -68,6 +108,9 @@ public function getDocumentMappingFiles()
}
}

/**
* @return array
*/
public function getDocumentNames()
{
$names = array();
Expand All @@ -87,6 +130,9 @@ public function getDocumentNames()
return $names;
}

/**
* @return array|\Iterator
*/
public function getRepositoryFiles()
{
try {
Expand Down
3 changes: 3 additions & 0 deletions Command/GenerateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\HttpKernel\Bundle\BundleInterface;

/**
* Generate Application entities from bundle entities.
Expand Down Expand Up @@ -74,6 +75,7 @@ protected function execute(InputInterface $input, OutputInterface $output)
$output->writeln('<error>You must provide a bundle name!</error>');
$output->writeln('');
$output->writeln(' Bundles availables :');
/** @var BundleInterface $bundle */
foreach ($this->getContainer()->get('kernel')->getBundles() as $bundle) {
$bundleMetadata = new BundleMetadata($bundle, $configuration);

Expand Down Expand Up @@ -117,6 +119,7 @@ protected function generate($bundleName, array $configuration, $output)
{
$processed = false;

/** @var BundleInterface $bundle */
foreach ($this->getContainer()->get('kernel')->getBundles() as $bundle) {
if ($bundle->getName() != $bundleName) {
continue;
Expand Down
Loading

0 comments on commit 0f615f4

Please sign in to comment.