Skip to content

Commit

Permalink
fix(field): normalize class name
Browse files Browse the repository at this point in the history
Signed-off-by: Thierry Bugier <tbugier@teclib.com>
  • Loading branch information
btry committed Oct 14, 2020
1 parent 076937b commit a27f82e
Show file tree
Hide file tree
Showing 37 changed files with 66 additions and 66 deletions.
2 changes: 1 addition & 1 deletion inc/field.class.php → inc/abstractfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@

require_once(realpath(dirname(__FILE__ ) . '/../../../inc/includes.php'));

abstract class PluginFormcreatorField implements PluginFormcreatorFieldInterface
abstract class PluginFormcreatorAbstractField implements PluginFormcreatorFieldInterface
{
/** @var array $fields Fields of an instance of PluginFormcreatorQuestion */
protected $question = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
die("Sorry. You can't access this file directly");
}

abstract class PluginFormcreatorQuestionParameter
abstract class PluginFormcreatorAbstractQuestionParameter
extends CommonDBChild
implements PluginFormcreatorQuestionParameterInterface, PluginFormcreatorExportableInterface
{
use PluginFormcreatorExportable;
use PluginFormcreatorExportableTrait;

// From CommonDBRelation
static public $itemtype = PluginFormcreatorQuestion::class;
Expand Down
4 changes: 2 additions & 2 deletions inc/abstracttarget.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ abstract class PluginFormcreatorAbstractTarget extends CommonDBChild implements
PluginFormcreatorTargetInterface,
PluginFormcreatorConditionnableInterface
{
use PluginFormcreatorConditionnable;
use PluginFormcreatorExportable;
use PluginFormcreatorConditionnableTrait;
use PluginFormcreatorExportableTrait;

static public $itemtype = PluginFormcreatorForm::class;
static public $items_id = 'plugin_formcreator_forms_id';
Expand Down
2 changes: 1 addition & 1 deletion inc/condition.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

class PluginFormcreatorCondition extends CommonDBChild implements PluginFormcreatorExportableInterface
{
use PluginFormcreatorExportable;
use PluginFormcreatorExportableTrait;

static public $itemtype = 'itemtype';
static public $items_id = 'items_id';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
die("Sorry. You can't access this file directly");
}

trait PluginFormcreatorConditionnable
trait PluginFormcreatorConditionnableTrait
{
public function updateConditions($input) {
if (!isset($input['show_rule'])) {
Expand Down
2 changes: 1 addition & 1 deletion inc/exportable.class.php → inc/exportabletrait.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
die("Sorry. You can't access this file directly");
}

trait PluginFormcreatorExportable
trait PluginFormcreatorExportableTrait
{
/**
* Insert the export of sub items in the export
Expand Down
4 changes: 2 additions & 2 deletions inc/field/actorfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

namespace GlpiPlugin\Formcreator\Field;

use PluginFormcreatorField;
use PluginFormcreatorAbstractField;
use Html;
use User;
use Toolbox;
Expand All @@ -43,7 +43,7 @@
* users from the itemtype User or email addresses. Email addresses allows to
* add actors who don't have an account in GLPI.
*/
class ActorField extends PluginFormcreatorField
class ActorField extends PluginFormcreatorAbstractField
{
public function isPrerequisites() {
return true;
Expand Down
4 changes: 2 additions & 2 deletions inc/field/checkboxesfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@

namespace GlpiPlugin\Formcreator\Field;

use PluginFormcreatorField;
use PluginFormcreatorAbstractField;
use Html;
use Toolbox;
use Session;
use PluginFormcreatorQuestionRange;

class CheckboxesField extends PluginFormcreatorField
class CheckboxesField extends PluginFormcreatorAbstractField
{
public function isPrerequisites() {
return true;
Expand Down
4 changes: 2 additions & 2 deletions inc/field/datefield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@

namespace GlpiPlugin\Formcreator\Field;

use PluginFormcreatorField;
use PluginFormcreatorAbstractField;
use Html;
use DateTime;
use Toolbox;
use Session;


class DateField extends PluginFormcreatorField
class DateField extends PluginFormcreatorAbstractField
{
const DATE_FORMAT = 'Y-m-d';

Expand Down
4 changes: 2 additions & 2 deletions inc/field/datetimefield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@

namespace GlpiPlugin\Formcreator\Field;

use PluginFormcreatorField;
use PluginFormcreatorAbstractField;
use Html;
use Session;
use Toolbox;
use DateTime;
class DatetimeField extends PluginFormcreatorField
class DatetimeField extends PluginFormcreatorAbstractField
{
/** @var array $fields Fields of an instance of PluginFormcreatorQuestion */
protected $fields = null;
Expand Down
4 changes: 2 additions & 2 deletions inc/field/descriptionfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@

namespace GlpiPlugin\Formcreator\Field;

use PluginFormcreatorField;
use PluginFormcreatorAbstractField;
use Session;
use GlpiPlugin\Formcreator\Exception\ComparisonException;

class DescriptionField extends PluginFormcreatorField
class DescriptionField extends PluginFormcreatorAbstractField
{
public function isPrerequisites() {
return true;
Expand Down
4 changes: 2 additions & 2 deletions inc/field/dropdownfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

namespace GlpiPlugin\Formcreator\Field;

use PluginFormcreatorField;
use PluginFormcreatorAbstractField;
use Html;
use Toolbox;
use Session;
Expand All @@ -50,7 +50,7 @@
use OLA;
use GlpiPlugin\Formcreator\Exception\ComparisonException;

class DropdownField extends PluginFormcreatorField
class DropdownField extends PluginFormcreatorAbstractField
{
public function isPrerequisites() {
$itemtype = $this->getSubItemtype();
Expand Down
4 changes: 2 additions & 2 deletions inc/field/filefield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

namespace GlpiPlugin\Formcreator\Field;

use PluginFormcreatorField;
use PluginFormcreatorAbstractField;
use Document;
use Html;
use Toolbox;
Expand All @@ -41,7 +41,7 @@
use PluginFormcreatorSection;
use PluginFormcreatorQuestion;

class FileField extends PluginFormcreatorField
class FileField extends PluginFormcreatorAbstractField
{
/**@var $uploadData array uploads saved as documents */
private $uploadData = [];
Expand Down
4 changes: 2 additions & 2 deletions inc/field/floatfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@

namespace GlpiPlugin\Formcreator\Field;

use PluginFormcreatorField;
use PluginFormcreatorAbstractField;
use Html;
use Toolbox;
use Session;
use PluginFormcreatorQuestionRange;
use PluginFormcreatorQuestionRegex;

class FloatField extends PluginFormcreatorField
class FloatField extends PluginFormcreatorAbstractField
{
public function isPrerequisites() {
return true;
Expand Down
4 changes: 2 additions & 2 deletions inc/field/hiddenfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@

namespace GlpiPlugin\Formcreator\Field;

use PluginFormcreatorField;
use PluginFormcreatorAbstractField;
use Html;
use Toolbox;

class HiddenField extends PluginFormcreatorField
class HiddenField extends PluginFormcreatorAbstractField
{
public function isPrerequisites() {
return true;
Expand Down
4 changes: 2 additions & 2 deletions inc/field/hostnamefield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,11 @@
*/
namespace GlpiPlugin\Formcreator\Field;

use PluginFormcreatorField;
use PluginFormcreatorAbstractField;
use Html;
use Toolbox;

class HostnameField extends PluginFormcreatorField
class HostnameField extends PluginFormcreatorAbstractField
{
public function isPrerequisites() {
return true;
Expand Down
4 changes: 2 additions & 2 deletions inc/field/ipfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@

namespace GlpiPlugin\Formcreator\Field;

use PluginFormcreatorField;
use PluginFormcreatorAbstractField;
use Html;
use Toolbox;
use GlpiPlugin\Formcreator\Exception\ComparisonException;

class IpField extends PluginFormcreatorField
class IpField extends PluginFormcreatorAbstractField
{
public function isPrerequisites() {
return true;
Expand Down
2 changes: 1 addition & 1 deletion inc/field/ldapselectfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

namespace GlpiPlugin\Formcreator\Field;

use PluginFormcreatorField;
use PluginFormcreatorAbstractField;
use AuthLDAP;
use Dropdown;
use Exception;
Expand Down
4 changes: 2 additions & 2 deletions inc/field/radiosfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@

namespace GlpiPlugin\Formcreator\Field;

use PluginFormcreatorField;
use PluginFormcreatorAbstractField;
use Html;
use Session;
use Toolbox;

class RadiosField extends PluginFormcreatorField
class RadiosField extends PluginFormcreatorAbstractField
{
public function isPrerequisites() {
return true;
Expand Down
4 changes: 2 additions & 2 deletions inc/field/textareafield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

namespace GlpiPlugin\Formcreator\Field;

use PluginFormcreatorField;
use PluginFormcreatorAbstractField;
use Html;
use Session;
use Toolbox;
Expand Down Expand Up @@ -68,7 +68,7 @@ public function getDesignSpecializationField() {
$additions .= '</td>';
$additions .= '</tr>';

$common = PluginFormcreatorField::getDesignSpecializationField();
$common = PluginFormcreatorAbstractField::getDesignSpecializationField();
$additions .= $common['additions'];

return [
Expand Down
4 changes: 2 additions & 2 deletions inc/field/textfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@
namespace GlpiPlugin\Formcreator\Field;

use Html;
use PluginFormcreatorField;
use PluginFormcreatorAbstractField;
use PluginFormcreatorQuestionRange;
use PluginFormcreatorQuestionRegex;
use Session;
use Toolbox;

class TextField extends PluginFormcreatorField
class TextField extends PluginFormcreatorAbstractField
{
public function isPrerequisites() {
return true;
Expand Down
4 changes: 2 additions & 2 deletions inc/field/timefield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,11 @@
namespace GlpiPlugin\Formcreator\Field;
use DateTime;
use Html;
use PluginFormcreatorField;
use PluginFormcreatorAbstractField;
use Session;
use Toolbox;

class TimeField extends PluginFormcreatorField
class TimeField extends PluginFormcreatorAbstractField
{
const DATE_FORMAT = 'H:i';

Expand Down
6 changes: 3 additions & 3 deletions inc/field/urgencyfield.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@

namespace GlpiPlugin\Formcreator\Field;

use PluginFormcreatorField;
use PluginFormcreatorAbstractField;
use Html;
use Session;
use Ticket;
class UrgencyField extends PluginFormcreatorField
class UrgencyField extends PluginFormcreatorAbstractField
{
public function isPrerequisites() {
return true;
Expand Down Expand Up @@ -68,7 +68,7 @@ public function getDesignSpecializationField() {
$additions .= '</td>';
$additions .= '</tr>';

$common = PluginFormcreatorField::getDesignSpecializationField();
$common = PluginFormcreatorAbstractField::getDesignSpecializationField();
$additions .= $common['additions'];

return [
Expand Down
4 changes: 2 additions & 2 deletions inc/fieldinterface.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -166,14 +166,14 @@ public function parseAnswerValues($input, $nonDestructive = false);
/**
* Gets the parameters of the field
*
* @return PluginFormcreatorQuestionParameter[]
* @return PluginFormcreatorAbstractQuestionParameter[]
*/
public function getEmptyParameters();

/**
* Gets parameters of the field with their settings
*
* @return PluginFormcreatorQuestionParameter[]
* @return PluginFormcreatorAbstractQuestionParameter[]
*/
public function getParameters();

Expand Down
4 changes: 2 additions & 2 deletions inc/fields.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@ public static function getFieldClassname($type) {
*/
public static function fieldTypeExists($type) {
$className = self::getFieldClassname($type);
return is_subclass_of($className, PluginFormcreatorField::class, true);
return is_subclass_of($className, PluginFormcreatorAbstractField::class, true);
}

/**
Expand All @@ -430,7 +430,7 @@ public static function fieldTypeExists($type) {
* @param string $type type of field to get
* @param PluginFormcreatorQuestion $question question representing the field
* @param array $data additional data
* @return null|PluginFormcreatorField
* @return null|PluginFormcreatorAbstractField
*/
public static function getFieldInstance($type, PluginFormcreatorQuestion $question) {
if (!self::fieldTypeExists($type)) {
Expand Down
6 changes: 3 additions & 3 deletions inc/form.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ class PluginFormcreatorForm extends CommonDBTM implements
PluginFormcreatorDuplicatableInterface,
PluginFormcreatorConditionnableInterface
{
use PluginFormcreatorConditionnable;
use PluginFormcreatorExportable;
use PluginFormcreatorConditionnableTrait;
use PluginFormcreatorExportableTrait;

static $rightname = 'entity';

Expand Down Expand Up @@ -2238,7 +2238,7 @@ public function getFromDBByQuestion(PluginFormcreatorQuestion $question) {
/**
* Get an array of instances of all fields for the form
*
* @return PluginFormcreatorField[]
* @return PluginFormcreatorAbstractField[]
*/
public function getFields() {
$fields = [];
Expand Down
2 changes: 1 addition & 1 deletion inc/form_profile.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

class PluginFormcreatorForm_Profile extends CommonDBRelation implements PluginFormcreatorExportableInterface
{
use PluginFormcreatorExportable;
use PluginFormcreatorExportableTrait;

static public $itemtype_1 = PluginFormcreatorForm::class;
static public $items_id_1 = 'plugin_formcreator_forms_id';
Expand Down
Loading

0 comments on commit a27f82e

Please sign in to comment.