Skip to content

Constant visibility type declarations #1260

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class ${NAME}#if (${EXTENDS}) extends ${EXTENDS}#end#if (${IMPLEMENTS}) implemen
/**
* Authorization level of a basic admin session
*/
const ADMIN_RESOURCE = '${ACL}';
public const ADMIN_RESOURCE = '${ACL}';

#end
/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,31 +12,31 @@ use $use;
class ${CLASS_NAME} implements ${IMPLEMENTS}
{
/**
* @var ${MODULE_DATA_SETUP_INTERFACE}
*/
private $moduleDataSetup;
* @var ${MODULE_DATA_SETUP_INTERFACE}
*/
private ${MODULE_DATA_SETUP_INTERFACE} $moduleDataSetup;

/**
* @var ${EAV_SETUP_FACTORY}
*/
private $eavSetupFactory;
/**
* @var ${EAV_SETUP_FACTORY}
*/
private ${EAV_SETUP_FACTORY} $eavSetupFactory;

/**
* @var ${EAV_CONFIG_CLASS}
*/
private $eavConfig;
* @var ${EAV_CONFIG_CLASS}
*/
private ${EAV_CONFIG_CLASS} $eavConfig;

/**
* @var ${ATTRIBUTE_RESOURCE}
*/
private $attributeResource;
* @var ${ATTRIBUTE_RESOURCE}
*/
private ${ATTRIBUTE_RESOURCE} $attributeResource;

/**
* @param ${MODULE_DATA_SETUP_INTERFACE} $moduleDataSetup
* @param ${EAV_SETUP_FACTORY} $eavSetupFactory
* @param ${EAV_CONFIG_CLASS} $eavConfig
* @param ${ATTRIBUTE_RESOURCE} $attributeResource
*/
/**
* @param ${MODULE_DATA_SETUP_INTERFACE} $moduleDataSetup
* @param ${EAV_SETUP_FACTORY} $eavSetupFactory
* @param ${EAV_CONFIG_CLASS} $eavConfig
* @param ${ATTRIBUTE_RESOURCE} $attributeResource
*/
public function __construct(
${MODULE_DATA_SETUP_INTERFACE} $moduleDataSetup,
${EAV_SETUP_FACTORY} $eavSetupFactory,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ interface ${NAME}
#set ($propertyData = $property.split(";"))
#set ($propertyUpperSnake = $propertyData.get(0))
#set ($propertyLowerSnake = $propertyData.get(1))
const $propertyUpperSnake = "$propertyLowerSnake";
public const $propertyUpperSnake = "$propertyLowerSnake";
#end
#end
#if (${PROPERTIES})
Expand Down
2 changes: 1 addition & 1 deletion resources/fileTemplates/internal/Magento Data Model.php.ft
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class ${NAME} #if (${EXTENDS})extends ${EXTENDS} #end #if (${IMPLEMENTS} && $has
#set ($propertyData = $property.split(";"))
#set ($propertyUpperSnake = $propertyData.get(0))
#set ($propertyLowerSnake = $propertyData.get(1))
const $propertyUpperSnake = "$propertyLowerSnake";
public const $propertyUpperSnake = "$propertyLowerSnake";
#end

#end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ class ${CLASS_NAME}
/**
* @var ${LOGGER}
*/
private $logger;
private ${LOGGER} $logger;

/**
* @var ${MODEL_FACTORY}
*/
private $modelFactory;
private ${MODEL_FACTORY} $modelFactory;

/**
* @var ${RESOURCE}
*/
private $resource;
private ${RESOURCE} $resource;

/**
* @param ${LOGGER} $logger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ class ${CLASS_NAME} implements ${IMPLEMENTS} {
/**
* @var ${MODULE_DATA_SETUP_INTERFACE}
*/
private $moduleDataSetup;
private ${MODULE_DATA_SETUP_INTERFACE} $moduleDataSetup;

/**
* @var ${EAV_SETUP_FACTORY}
*/
private $eavSetupFactory;
private ${EAV_SETUP_FACTORY} $eavSetupFactory;

/**
* @param ${MODULE_DATA_SETUP_INTERFACE} $moduleDataSetup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ${CLASS_NAME}
/**
* @var ${DTO_FACTORY}
*/
private $entityDtoFactory;
private ${DTO_FACTORY} $entityDtoFactory;

/**
* @param ${DTO_FACTORY} $entityDtoFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ class ${CLASS_NAME} extends ${EXTENDS} implements ${IMPLEMENTS_POST}, ${IMPLEMEN
*
* @see _isAllowed()
*/
const ADMIN_RESOURCE = '${ADMIN_RESOURCE}';
public const ADMIN_RESOURCE = '${ADMIN_RESOURCE}';

/**
* @var ${DELETE_COMMAND}
*/
private $deleteByIdCommand;
private ${DELETE_COMMAND} $deleteByIdCommand;

/**
* @param Context $context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ${CLASS_NAME} extends ${EXTENDS} implements ${IMPLEMENTS}
*
* @see _isAllowed()
*/
const ADMIN_RESOURCE = '${ADMIN_RESOURCE}';
public const ADMIN_RESOURCE = '${ADMIN_RESOURCE}';

/**
* Edit ${ENTITY_NAME} action.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class ${CLASS_NAME} extends ${PARENT_CLASS_NAME} implements ${HTTP_GET_METHOD}
/**
* Authorization level of a basic admin session.
*/
const ADMIN_RESOURCE = '${ACL}';
public const ADMIN_RESOURCE = '${ACL}';

/**
* Execute action based on request and return result.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class ${CLASS_NAME} extends ${EXTENDS} implements ${IMPLEMENTS}
*
* @see _isAllowed()
*/
const ADMIN_RESOURCE = '${ADMIN_RESOURCE}';
public const ADMIN_RESOURCE = '${ADMIN_RESOURCE}';

/**
* Create new ${ENTITY_NAME} action.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,22 +18,22 @@ class ${CLASS_NAME} extends ${EXTENDS} implements ${IMPLEMENTS}
*
* @see _isAllowed()
*/
const ADMIN_RESOURCE = '${ADMIN_RESOURCE}';
public const ADMIN_RESOURCE = '${ADMIN_RESOURCE}';

/**
* @var ${DATA_PERSISTOR}
*/
private $dataPersistor;
private ${DATA_PERSISTOR} $dataPersistor;

/**
* @var ${SAVE_COMMAND}
*/
private $saveCommand;
private ${SAVE_COMMAND} $saveCommand;

/**
* @var ${ENTITY_DTO_FACTORY}
*/
private $entityDataFactory;
private ${ENTITY_DTO_FACTORY} $entityDataFactory;

/**
* @param Context $context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,27 +16,27 @@ class ${CLASS_NAME}
/**
* @var ${COLLECTION_PROCESSOR_TYPE}
*/
private $collectionProcessor;
private ${COLLECTION_PROCESSOR_TYPE} $collectionProcessor;

/**
* @var ${ENTITY_COLLECTION_FACTORY_TYPE}
*/
private $entityCollectionFactory;
private ${ENTITY_COLLECTION_FACTORY_TYPE} $entityCollectionFactory;

/**
* @var ${ENTITY_DATA_MAPPER_TYPE}
*/
private $entityDataMapper;
private ${ENTITY_DATA_MAPPER_TYPE} $entityDataMapper;

/**
* @var ${SEARCH_CRITERIA_BUILDER_TYPE}
*/
private $searchCriteriaBuilder;
private ${SEARCH_CRITERIA_BUILDER_TYPE} $searchCriteriaBuilder;

/**
* @var ${SEARCH_RESULT_FACTORY_TYPE}
*/
private $searchResultFactory;
private ${SEARCH_RESULT_FACTORY_TYPE} $searchResultFactory;

/**
* @param ${COLLECTION_PROCESSOR_TYPE} $collectionProcessor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class ${CLASS_NAME} extends ${PARENT_CLASS}
/**
* @var ${URL}
*/
private $urlBuilder;
private ${URL} $urlBuilder;

/**
* @param ${CONTEXT} $context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ${CLASS_NAME} implements DataPatchInterface
/**
* @var ModuleDataSetupInterface
*/
private $moduleDataSetup;
private ModuleDataSetupInterface $moduleDataSetup;

/**
* @param ModuleDataSetupInterface $moduleDataSetup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ class ${CLASS_NAME}
/**
* @var ${CONTEXT}
*/
private $context;
private ${CONTEXT} $context;

/**
* @var ${URL}
*/
private $urlBuilder;
private ${URL} $urlBuilder;

/**
* @param ${CONTEXT} $context
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ class ${CLASS_NAME}
/**
* @var ${LOGGER}
*/
private $logger;
private ${LOGGER} $logger;

/**
* @var ${MODEL_FACTORY}
*/
private $modelFactory;
private ${MODEL_FACTORY} $modelFactory;

/**
* @var ${RESOURCE}
*/
private $resource;
private ${RESOURCE} $resource;

/**
* @param ${LOGGER} $logger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@ class ${CLASS_NAME} extends ${EXTENDS}
/**
* @var ${GET_LIST_QUERY_TYPE}
*/
private $getListQuery;
private ${GET_LIST_QUERY_TYPE} $getListQuery;

/**
* @var ${SEARCH_RESULT_FACTORY}
*/
private $searchResultFactory;
private ${SEARCH_RESULT_FACTORY} $searchResultFactory;

/**
* @var array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ class AddTestAttributeCategoryAttribute implements DataPatchInterface
/**
* @var ModuleDataSetupInterface
*/
private $moduleDataSetup;
private ModuleDataSetupInterface $moduleDataSetup;

/**
* @var EavSetupFactory
*/
private $eavSetupFactory;
private EavSetupFactory $eavSetupFactory;

/**
* @param ModuleDataSetupInterface $moduleDataSetup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,22 @@ class AddMultiselectTestCustomerAttribute implements DataPatchInterface
/**
* @var ModuleDataSetupInterface
*/
private $moduleDataSetup;
private ModuleDataSetupInterface $moduleDataSetup;

/**
* @var EavSetupFactory
*/
private $eavSetupFactory;
private EavSetupFactory $eavSetupFactory;

/**
* @var Config
*/
private $eavConfig;
private Config $eavConfig;

/**
* @var Attribute
*/
private $attributeResource;
private Attribute $attributeResource;

/**
* @param ModuleDataSetupInterface $moduleDataSetup
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ class Sample extends DataObject
/**
* String constants for property names.
*/
const ID_PROPERTY = "id_property";
const SAMPLE_PROPERTY = "sample_property";
public const ID_PROPERTY = "id_property";
public const SAMPLE_PROPERTY = "sample_property";

/**
* Getter for IdProperty.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ interface SampleInterface
/**
* String constants for property names
*/
const ID_PROPERTY = "id_property";
const SAMPLE_PROPERTY = "sample_property";
public const ID_PROPERTY = "id_property";
public const SAMPLE_PROPERTY = "sample_property";

/**
* Getter for IdProperty.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ class DeleteByIdCommand
/**
* @var LoggerInterface
*/
private $logger;
private LoggerInterface $logger;

/**
* @var BookModelFactory
*/
private $modelFactory;
private BookModelFactory $modelFactory;

/**
* @var BookResource
*/
private $resource;
private BookResource $resource;

/**
* @param LoggerInterface $logger
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ class Delete extends Action implements HttpPostActionInterface, HttpGetActionInt
*
* @see _isAllowed()
*/
const ADMIN_RESOURCE = 'Foo_Bar::company_id';
public const ADMIN_RESOURCE = 'Foo_Bar::company_id';

/**
* @var DeleteByIdCommand
*/
private $deleteByIdCommand;
private DeleteByIdCommand $deleteByIdCommand;

/**
* @param Context $context
Expand Down
Loading