1. Programming Basics

Descripción

TYPO3 (1. Programming Basics) TYPO3 CD 2020 (zweite Auflage) Test sobre 1. Programming Basics, creado por Ma Hi el 25/03/2021.
Ma Hi
Test por Ma Hi, actualizado hace más de 1 año
Ma Hi
Creado por Ma Hi hace más de 3 años
10
0

Resumen del Recurso

Pregunta 1

Pregunta
What are valid PHP namespaces for TYPO3 extensions? (2)
Respuesta
  • \typo3\MyExtension
  • \TYPO3\CMS\MyExtension
  • \VendorName\MyExtension
  • \Symfony\Console
  • \vendor_name\my_extension
  • \AwesomeNerds\my_extension

Pregunta 2

Pregunta
What are “return type declarations”? (2)
Respuesta
  • They declare the type of an extension, e.g. “frontend plugin” or “backend module”.
  • They specify how many methods a PHP class may contain.
  • They specify the maximum time allowed to return an object.
  • They specify the type of the value that is returned from a function or method.
  • Return values can be marked as “nullable” by prefixing the type name with a question mark since PHP version 7.1.

Pregunta 3

Pregunta
What does the “strict mode” do in PHP and how do you enable it? (2)
Respuesta
  • The strict mode ensures that a variable passed to a function must exactly be of the declared type.
  • The strict mode allows developers to restrict access to class properties.
  • With the strict mode enabled, class names must be written in lowerCamelCase.
  • The strict mode can be enabled and disabled in the TYPO3 Install Tool as required.
  • The strict mode can be enabled by adding the line declare(strict_types = 1); at the top of the PHP file.

Pregunta 4

Pregunta
Which statements about the PHP strict mode in TYPO3 extensions are correct? (3)
Respuesta
  • The PHP strict mode must not be used in any TYPO3 extension files at all (TYPO3 v9 LTS does not support this feature).
  • The PHP strict mode must not be enabled in the file ext_tables.php.
  • The PHP strict mode must not be enabled in the file ext_localconf.php.
  • The PHP strict mode must not be enabled in any TCA files under Configuration/TCA/.
  • If the PHP strict mode is enabled in controller classes, the output of the action methods is not cached.

Pregunta 5

Pregunta
Which standards should be followed when you develop TYPO3 extensions or contribute to the TYPO3 core? (3)
Respuesta
  • PHP coding guidelines, following the PSR-2 standard.
  • Style Guide for PHP Code (PEP-8).
  • Specific guidelines apply to PHP file and directory names.
  • The X-Mas Standard Policy applies to XLIFF language files.
  • The Airbnb JavaScript Style Guide should be used for JavaScript files.
  • TYPO3 is open-source software and therefore no coding guidelines exist.

Pregunta 6

Pregunta
Which coding rules apply in TYPO3 according to the PSR standard? (2)
Respuesta
  • Opening curly braces for classes must go on the same line.
  • Opening curly braces for classes must go on the next line.
  • Opening curly braces for if-statements must go on the same line.
  • Opening curly braces for if-statements must go on the next line.
  • TYPO3 does not adhere to any coding guidelines.

Pregunta 7

Pregunta
Which coding rules apply in TYPO3 according to the PSR standard? (3)
Respuesta
  • The maximum length of a line must not exceed 80 characters.
  • Code must use four spaces for indenting, not tabs.
  • A PHP file must not contain the closing PHP tag ?> at the end.
  • Spaces are not allowed at the end of lines.
  • Spaces are not allowed after a comma.

Pregunta 8

Pregunta
What issues in the following code violate the official TYPO3 coding guidelines? (2)
Respuesta
  • The namespace declaration must not start with a backslash \.
  • The opening curly bracket for PHP classes must go on the next line.
  • The opening curly bracket for methods must be on the same line as the method definition.
  • The comments with the annotation must start with /* rather than /**.

Pregunta 9

Pregunta
What issues in the following code violate the official TYPO3 coding guidelines? (2)
Respuesta
  • The fully qualified class name (FQCN) must always be used.
  • Property names must be written in lowerCamelCase.
  • There must not be a return type hint “string”.
  • There must not be a closing ?> tag.

Pregunta 10

Pregunta
Which coding rules apply to JavaScript files in TYPO3 projects? (2)
Respuesta
  • JavaScript files of the TYPO3 core must be located under typo3conf/assets/javascript/.
  • JavaScript files in extensions should be located under Resources/Public/JavaScript/.
  • TABs should be used for line indenting.
  • Strings should always use double-quotes (").
  • File endings of JavaScript files should be .js.

Pregunta 11

Pregunta
Which statements about semantic versioning are correct? (2)
Respuesta
  • A versioning scheme following semantic versioning has exactly two numbers separated by dots, e.g. 1.2.
  • A versioning scheme following semantic versioning has exactly three numbers separated by dots, e.g. 1.2.3.
  • A versioning scheme following semantic versioning has exactly four numbers separated by dots, e.g. 1.2.3.4.
  • The last number represents “patch” versions when developers make backwards-compatible bug fixes.
  • The first number indicates if a release is a long-term support release (LTS).

Pregunta 12

Pregunta
Which statements about semantic versioning are correct? (2)
Respuesta
  • Semantic versioning dictates that LTS-releases are marked appropriately, e.g. 1.2.3-lts.
  • When developers fix a bug and release a backwards-compatible version, the patch number of the version should be increased.
  • Semantic versioning is part of the PSR-2 coding standard.
  • Semantic versioning introduces conventions about breaking changes and aim to make upgrade dependencies safe.

Pregunta 13

Pregunta
Which statements about the composer.json file of a TYPO3 extension are correct? (2)
Respuesta
  • The property type must be set to typo3-cms-extension.
  • The property type must be set to plugin, if the extension provides a frontend plugin.
  • The extension version is required and must be set with the property version.
  • PHP classes should be auto-loaded with the appropriate namespace and path information.

Pregunta 14

Pregunta
How do you make sure that a Composer package with a specific version does not get updated when you run the composer update command? (1)
Respuesta
  • By adding a file DO_NOT_UPDATE to the extension directory.
  • By adding the Composer namespace of the extension to the update-lock property in the composer.json file.
  • By setting the exact version number with composer require.
  • This is not possible, because composer update always forces updates.

Pregunta 15

Pregunta
How do you install version 9.10.2 of the extension “Extension Builder” as an additional extension in an existing TYPO3 instance using Composer, assuming you have not added this package as a requirement yet? (1) Note: the Composer namespace of the extension reads “friendsoftypo3/extension-builder”.
Respuesta
  • composer install friendsoftypo3/extension-builder:9.10.2
  • composer install friendsoftypo3/extension-builder --version 9.10.2
  • composer require friendsoftypo3/extension-builder/9.10.2
  • composer require friendsoftypo3/extension-builder:9.10.2
  • composer require --version=9.10.2 --vendor=friendsoftypo3 extension-builder

Pregunta 16

Pregunta
What needs to be configured to auto-load PHP classes of a TYPO3 extension in a Composer-based setup? (1)
Respuesta
  • The PSR-4 autoload information needs to be added to the file ext_localconf.php: $GLOBALS['TYPO3_CONF_VARS']['autoload'][$_EXTKEY] = [ "psr-4" => [ "Vendor\\MyExtension\\": "Classes/" ] ];
  • The PSR-4 autoload information needs to be added to the file composer.json: "autoload": { "psr-4": { "Vendor\\MyExtension\\": "Classes/" } }
  • A configuration file autoload.yaml in the typo3conf/ directory.
  • A configuration file autoload.php in the typo3temp/ directory.

Pregunta 17

Pregunta
You want to update a Composer package that uses semantic versioning. Which version constraint do you use to get bug fixes only? (2)
Respuesta
  • =1.2.3
  • ^1.2.3
  • ~1.2.3
  • 1.2.*
  • =bugfix

Pregunta 18

Pregunta
You want to update a Composer package that uses semantic versioning. Which version constraint do you use if you want non-breaking updates only? (1)
Respuesta
  • =1.2.3
  • ^1.2.3
  • ~1.2.3
  • *1.2.3

Pregunta 19

Pregunta
Which statements about importing class names with the help of the use-statement are correct? (3)
Respuesta
  • They should be used in TCA files located at Configuration/TCA/.
  • They must not be used in the ext_tables.php file.
  • They must not be used in the ext_localconf.php file.
  • They can not be used for type annotations of Extbase model properties.
  • Importing class names require PHP version 7.2 at least.
  • Importing class names only work, if this feature is enabled in the Install Tool.

Pregunta 20

Pregunta
Where can you import class names with the help of the use-statement? (2)
Respuesta
  • In repository class definitions, when extending the class TYPO3\CMS\Extbase\Persistence\Repository.
  • In ext_localconf.php files of extensions.
  • In type annotations of Extbase controller action arguments.
  • Importing class names is not supported by TYPO3 and Extbase at all.

Pregunta 21

Pregunta
Which of the following DocBlock and inline comments are valid by convention? (2)
Respuesta
  • /** * @param $blog \Vendor\MyExtension\Domain\Model\Blog */
  • /** * @param \Vendor\MyExtension\Domain\Model\Blog $blog */
  • /** @var $blog \Vendor\MyExtension\Domain\Model\Blog */
  • // @var $blog \Vendor\MyExtension\Domain\Model\Blog
Mostrar resumen completo Ocultar resumen completo

Similar

Martin Luther King, Jr.
maya velasquez
Selectividad: Horario de Estudio (1 mes)
maya velasquez
Calendario del curso
mari.diaz26
Partes de la célula animal y vegetal
Cami Puaque
Glucólisis
Nadim Bissar
Todos mis RECURSOS...
Ulises Yo
LEY 1/2000 ENJUICIAMIENTO CIVIL: "De los procesos matrimoniales y de menores" (I)
Miguel Angel del Rio
PRESENT SIMPLE 2 MULTIPLE CHOICE
Silvia Francisco Llorente
Anatomía Animal (Sistema Óseo)
Ana Favela
CLASIFICACIÓN DE TEXTO : Tipos de texto
Paula Andrea Cabeza Nova