Skip to content

Commit

Permalink
fix intefaces and for linters
Browse files Browse the repository at this point in the history
  • Loading branch information
luckyraul committed Jan 23, 2019
1 parent 434f8a8 commit b0daacb
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion src/Jeeves/Console/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

class Application extends BaseApplication
{
const VERSION = '0.0.12';
const VERSION = '0.0.13';
const GEN = 'generate';

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Jeeves/Generators/Crud/Interfaces.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function genModelInterface($className, $rootNamespace, $fields = self::DE
$interface->addMethod('set' . $method)
->addComment('Set ' . str_replace('_', ' ', $name))
->addComment('@param ' . $this->convertType($value['type']) . ' $' . $this->snakeCaseToCamelCase($name))
->addComment('@return \\' . $rootNamespace . '\Api\Data\\' . $className)
->addComment('@return $this')
->setVisibility('public')
->addParameter($this->snakeCaseToCamelCase($name));
}
Expand Down
2 changes: 1 addition & 1 deletion src/Jeeves/Generators/Crud/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function genModel($className, $entInterface, $resource, $rootNamespace, $
$setter = $class->addMethod('set' . $method)
->addComment('Set ' . str_replace('_', ' ', $name))
->addComment('@param ' . $this->convertType($value['type']) . ' $' . $this->snakeCaseToCamelCase($name))
->addComment('@return ' . $entInterface)
->addComment('@return $this')
->setVisibility('public');
$setter->addParameter($this->snakeCaseToCamelCase($name));
$setter->setBody('return $this->setData(self::' . strtoupper($name) . ', $' . $this->snakeCaseToCamelCase($name) . ');');
Expand Down
4 changes: 2 additions & 2 deletions src/Jeeves/Generators/Crud/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function genRepository(

$getById = $class->addMethod('getById')
->addComment('@param int $entityId')
->addComment('@return ' . $entity)
->addComment('@return ' . $entityInterface)
->addComment('@throws \Magento\Framework\Exception\NoSuchEntityException')
->setVisibility('public');

Expand All @@ -68,7 +68,7 @@ public function genRepository(

$save = $class->addMethod('save')
->addComment('@param ' . $entityInterface . ' $entity')
->addComment('@return ' . $entity)
->addComment('@return ' . $entityInterface)
->addComment('@throws \Magento\Framework\Exception\CouldNotSaveException')
->setVisibility('public');

Expand Down
8 changes: 4 additions & 4 deletions test/Expectations/Crud/Api/Data/BannerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public function getId();
/**
* Set id
* @param int $id
* @return \Mygento\SampleModule\Api\Data\BannerInterface
* @return $this
*/
public function setId($id);

Expand All @@ -31,7 +31,7 @@ public function getName();
/**
* Set name
* @param string $name
* @return \Mygento\SampleModule\Api\Data\BannerInterface
* @return $this
*/
public function setName($name);

Expand All @@ -44,7 +44,7 @@ public function getSubname();
/**
* Set subname
* @param string $subname
* @return \Mygento\SampleModule\Api\Data\BannerInterface
* @return $this
*/
public function setSubname($subname);

Expand All @@ -57,7 +57,7 @@ public function getProductId();
/**
* Set product id
* @param int $productId
* @return \Mygento\SampleModule\Api\Data\BannerInterface
* @return $this
*/
public function setProductId($productId);
}
10 changes: 5 additions & 5 deletions test/Expectations/Crud/Api/Data/CustomerAddressInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function getId();
/**
* Set id
* @param int $id
* @return \Mygento\SampleModule\Api\Data\CustomerAddressInterface
* @return $this
*/
public function setId($id);

Expand All @@ -32,7 +32,7 @@ public function getCity();
/**
* Set city
* @param string $city
* @return \Mygento\SampleModule\Api\Data\CustomerAddressInterface
* @return $this
*/
public function setCity($city);

Expand All @@ -45,7 +45,7 @@ public function getCreatedAt();
/**
* Set created at
* @param string $createdAt
* @return \Mygento\SampleModule\Api\Data\CustomerAddressInterface
* @return $this
*/
public function setCreatedAt($createdAt);

Expand All @@ -58,7 +58,7 @@ public function getUpdatedAt();
/**
* Set updated at
* @param string $updatedAt
* @return \Mygento\SampleModule\Api\Data\CustomerAddressInterface
* @return $this
*/
public function setUpdatedAt($updatedAt);

Expand All @@ -71,7 +71,7 @@ public function getPrice();
/**
* Set price
* @param float $price
* @return \Mygento\SampleModule\Api\Data\CustomerAddressInterface
* @return $this
*/
public function setPrice($price);
}
8 changes: 4 additions & 4 deletions test/Expectations/Crud/Model/Banner.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function getId()
/**
* Set id
* @param int $id
* @return \Mygento\SampleModule\Api\Data\BannerInterface
* @return $this
*/
public function setId($id)
{
Expand All @@ -45,7 +45,7 @@ public function getName()
/**
* Set name
* @param string $name
* @return \Mygento\SampleModule\Api\Data\BannerInterface
* @return $this
*/
public function setName($name)
{
Expand All @@ -64,7 +64,7 @@ public function getSubname()
/**
* Set subname
* @param string $subname
* @return \Mygento\SampleModule\Api\Data\BannerInterface
* @return $this
*/
public function setSubname($subname)
{
Expand All @@ -83,7 +83,7 @@ public function getProductId()
/**
* Set product id
* @param int $productId
* @return \Mygento\SampleModule\Api\Data\BannerInterface
* @return $this
*/
public function setProductId($productId)
{
Expand Down
4 changes: 2 additions & 2 deletions test/Expectations/Crud/Model/BannerRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function __construct(
/**
* @param int $entityId
* @throws \Magento\Framework\Exception\NoSuchEntityException
* @return \Mygento\SampleModule\Model\Banner
* @return \Mygento\SampleModule\Api\Data\BannerInterface
*/
public function getById($entityId)
{
Expand All @@ -60,7 +60,7 @@ public function getById($entityId)
/**
* @param \Mygento\SampleModule\Api\Data\BannerInterface $entity
* @throws \Magento\Framework\Exception\CouldNotSaveException
* @return \Mygento\SampleModule\Model\Banner
* @return \Mygento\SampleModule\Api\Data\BannerInterface
*/
public function save(\Mygento\SampleModule\Api\Data\BannerInterface $entity)
{
Expand Down
10 changes: 5 additions & 5 deletions test/Expectations/Crud/Model/CustomerAddress.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function getId()
/**
* Set id
* @param int $id
* @return \Mygento\SampleModule\Api\Data\CustomerAddressInterface
* @return $this
*/
public function setId($id)
{
Expand All @@ -45,7 +45,7 @@ public function getCity()
/**
* Set city
* @param string $city
* @return \Mygento\SampleModule\Api\Data\CustomerAddressInterface
* @return $this
*/
public function setCity($city)
{
Expand All @@ -64,7 +64,7 @@ public function getCreatedAt()
/**
* Set created at
* @param string $createdAt
* @return \Mygento\SampleModule\Api\Data\CustomerAddressInterface
* @return $this
*/
public function setCreatedAt($createdAt)
{
Expand All @@ -83,7 +83,7 @@ public function getUpdatedAt()
/**
* Set updated at
* @param string $updatedAt
* @return \Mygento\SampleModule\Api\Data\CustomerAddressInterface
* @return $this
*/
public function setUpdatedAt($updatedAt)
{
Expand All @@ -102,7 +102,7 @@ public function getPrice()
/**
* Set price
* @param float $price
* @return \Mygento\SampleModule\Api\Data\CustomerAddressInterface
* @return $this
*/
public function setPrice($price)
{
Expand Down
4 changes: 2 additions & 2 deletions test/Expectations/Crud/Model/CustomerAddressRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public function __construct(
/**
* @param int $entityId
* @throws \Magento\Framework\Exception\NoSuchEntityException
* @return \Mygento\SampleModule\Model\CustomerAddress
* @return \Mygento\SampleModule\Api\Data\CustomerAddressInterface
*/
public function getById($entityId)
{
Expand All @@ -60,7 +60,7 @@ public function getById($entityId)
/**
* @param \Mygento\SampleModule\Api\Data\CustomerAddressInterface $entity
* @throws \Magento\Framework\Exception\CouldNotSaveException
* @return \Mygento\SampleModule\Model\CustomerAddress
* @return \Mygento\SampleModule\Api\Data\CustomerAddressInterface
*/
public function save(\Mygento\SampleModule\Api\Data\CustomerAddressInterface $entity)
{
Expand Down

0 comments on commit b0daacb

Please sign in to comment.