for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Distilleries\Contentful\Commands\Generators\Definitions;
use Exception;
class ArrayDefinition extends BaseDefinition
{
/**
* {@inheritdoc}
*/
public function modelGetter()
switch ($this->field['items']['type']) {
case 'Link':
$stubPath = __DIR__ . '/stubs/entries.stub';
break;
case 'Symbol':
$stubPath = __DIR__ . '/stubs/string.stub';
default:
throw new Exception('Unknown Array items type "' . $this->field['items']['type'] . '"');
}
return self::getStub($stubPath, [
'field' => $this->id(),
'field_studly' => $this->studlyId(),
]);
public function modelProperty()
$property = ' * @property ';
$property .= '\Illuminate\Support\Collection';
$property .= 'string';
return $property . ' $' . $this->snakeId();