Skip to content

Commit

Permalink
Merge pull request #103 from mmoreram/feature/version-2
Browse files Browse the repository at this point in the history
Refactoring for v^2
  • Loading branch information
mmoreram authored Jan 14, 2017
2 parents 7fa1e8e + 8681541 commit 0e8050c
Show file tree
Hide file tree
Showing 97 changed files with 2,369 additions and 5,342 deletions.
1 change: 1 addition & 0 deletions .formatter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use-sort:
group-type: each
sort-type: alph
sort-direction: asc
strict: true
header: |
/*
* This file is part of the ControllerExtraBundle for Symfony2.
Expand Down
12 changes: 2 additions & 10 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,8 @@ sudo: false

matrix:
include:
- php: 5.6
env: COMPOSER_OPTIONS="--prefer-lowest"
- php: 5.6
env: $SYMFONY_VERSION="^2.8.0"
- php: 7.0
env: $SYMFONY_VERSION="^3.0.0"
- php: 7.1
env: $SYMFONY_VERSION="^3.1.0"
- php: 5.6
env: $SYMFONY_VERSION="^3.1.0"
env: $SYMFONY_VERSION="^3.2"

before_install:
- 'if [ "$SYMFONY_VERSION" != "" ]; then composer require --no-update symfony/symfony:${SYMFONY_VERSION}; fi;'
Expand All @@ -22,7 +14,7 @@ install:
- composer update --prefer-source --no-interaction ${COMPOSER_OPTIONS}

script:
- phpunit
- php vendor/bin/phpunit

notifications:
email: false
Original file line number Diff line number Diff line change
Expand Up @@ -11,23 +11,23 @@
* @author Marc Morera <[email protected]>
*/

namespace Mmoreram\ControllerExtraBundle\Annotation\Abstracts;
declare(strict_types=1);

namespace Mmoreram\ControllerExtraBundle\Annotation;

use Doctrine\Common\Annotations\Annotation as DoctrineAnnotation;

/**
* Flush annotation driver.
*
* @Annotation
*/
abstract class Annotation extends DoctrineAnnotation
{
/**
* return value.
*
* @return string Value
* @return null|string Value
*/
public function getValue()
public function getValue() : ? string
{
return $this->value;
}
Expand Down
73 changes: 73 additions & 0 deletions Annotation/AnnotationWithEntityReference.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
<?php

/*
* This file is part of the ControllerExtraBundle for Symfony2.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*
* Feel free to edit as you please, and have fun.
*
* @author Marc Morera <[email protected]>
*/

declare(strict_types=1);

namespace Mmoreram\ControllerExtraBundle\Annotation;

/**
* Class AnnotationWithEntityReference.
*/
abstract class AnnotationWithEntityReference extends Annotation
{
/**
* @var string
*
* Entity namespace
*/
protected $namespace;

/**
* @var array
*
* Factory
*/
protected $factory;

/**
* @var string
*
* Repository
*/
protected $repository;

/**
* return namespace.
*
* @return null|string Namespace
*/
public function getNamespace() : ? string
{
return $this->namespace;
}

/**
* Get Factory.
*
* @return null|array
*/
public function getFactory() : ? array
{
return $this->factory;
}

/**
* Get Repository.
*
* @return null|array
*/
public function getRepository() : ? array
{
return $this->repository;
}
}
43 changes: 22 additions & 21 deletions Annotation/Form.php → Annotation/CreateForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,99 +11,100 @@
* @author Marc Morera <[email protected]>
*/

namespace Mmoreram\ControllerExtraBundle\Annotation;
declare(strict_types=1);

use Mmoreram\ControllerExtraBundle\Annotation\Abstracts\Annotation;
namespace Mmoreram\ControllerExtraBundle\Annotation;

/**
* Form annotation driver.
* Class CreateForm.
*
* @Annotation
* @Target({"METHOD"})
*/
class Form extends Annotation
final class CreateForm extends Annotation
{
/**
* @var string
*
* Name of the parameter
*/
public $name;
protected $name;

/**
* @var string
*
* Name of form. This value can refer to a namespace or a service alias
*/
public $class;
protected $class;

/**
* @var entity
* @var string
*
* Entity from Request ParameterBag to use where building form
*/
public $entity;
protected $entity;

/**
* @var bool
*
* Handle request
*/
public $handleRequest = false;
protected $handleRequest = false;

/**
* @var validate
* @var bool
*
* Validates submited form if Request is handled.
* Name of field to set result
*/
public $validate = false;
protected $validate = false;

/**
* return name.
*
* @return string Name
* @return null|string
*/
public function getName()
public function getName() : ? string
{
return $this->name;
}

/**
* return class.
*
* @return string Class
* @return null|string
*/
public function getClass()
public function getClass() : ? string
{
return $this->class;
}

/**
* return entity.
*
* @return string Entity
* @return string
*/
public function getEntity()
public function getEntity() : ? string
{
return $this->entity;
}

/**
* return handle request.
*
* @return string Handle Request
* @return bool
*/
public function getHandleRequest()
public function getHandleRequest() : bool
{
return $this->handleRequest;
}

/**
* return validate value.
*
* @return string Validate param name
* @return bool
*/
public function getValidate()
public function getValidate() : bool
{
return $this->validate;
}
Expand Down
Loading

0 comments on commit 0e8050c

Please sign in to comment.