Adds interfaces to many classes.

This commit is contained in:
2022-09-03 12:48:53 +02:00
parent 0512af0f33
commit 4a32d3d50e
34 changed files with 613 additions and 128 deletions

View File

@@ -0,0 +1,29 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces\Component;
/**
* Component Placeholder Interface
*/
interface PlaceholderInterface
{
/**
* get all System Placeholders
*
* @return array The global placeholders
*
* @since 3.2.0
*/
public function get();
}

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,60 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces\Customcode;
/**
* Customcode Dispenser Interface
*/
interface DispenserInterface
{
/**
* Set the script for the customcode dispenser
*
* @param string $script The script
* @param string $first The first key
* @param string|null $second The second key (if not set we use only first key)
* @param string|null $third The third key (if not set we use only first and second key)
* @param array $config The config options
* @param bool $base64 The switch to decode base64 the script
* default: true
* @param bool $dynamic The switch to dynamic update the script
* default: true
* @param bool $add The switch to add to exiting instead of replace
* default: false
*
* @return bool true on success
* @since 3.2.0
*/
public function set(&$script, string $first, ?string $second = null, ?string $third = null,
array $config = array(), bool $base64 = true, bool $dynamic = true, bool $add = false): bool;
/**
* Get the script from the customcode dispenser
*
* @param string $first The first key
* @param string $second The second key
* @param string $prefix The prefix to add in front of the script if found
* @param string|null $note The switch/note to add to the script
* @param bool $unset The switch to unset the value if found
* @param mixed|null $default The switch/string to use as default return if script not found
* @param string $suffix The suffix to add after the script if found
*
* @return mixed The string/script if found or the default value if not found
*
* @since 3.2.0
*/
public function get(string $first, string $second, string $prefix = '', ?string $note = null,
bool $unset = false, $default = null, string $suffix = '');
}

View File

@@ -0,0 +1,31 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces\Customcode;
/**
* Customcode External Interface
*/
interface ExternalInterface
{
/**
* Set the external code string & load it in to string
*
* @param string $string The content to check
* @param int $debug The switch to debug the update
*
* @return string
* @since 3.2.0
*/
public function set(string $string, int $debug = 0): string;
}

View File

@@ -0,0 +1,28 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces\Customcode;
/**
* Customcode Extractor Interface
*/
interface ExtractorInterface
{
/**
* get the custom code from the local files
*
* @return void
* @since 3.2.0
*/
public function run();
}

View File

@@ -0,0 +1,44 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces\Customcode;
/**
* Customcode Gui Interface
*/
interface GuiInterface
{
/**
* Set the JCB GUI code placeholder
*
* @param string $string The code string
* @param array $config The placeholder config values
*
* @return string
* @since 3.2.0
*/
public function set(string $string, array $config): string;
/**
* search a file for gui code blocks that were updated in the IDE
*
* @param string $file The file path to search
* @param array $placeholders The values to replace in the code being stored
* @param string $today The date for today
* @param string $target The target path type
*
* @return void
* @since 3.2.0
*/
public function search(string &$file, array &$placeholders, string &$today, string &$target);
}

View File

@@ -0,0 +1,30 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces\Customcode;
/**
* Customcode LockBase Interface
*/
interface LockBaseInterface
{
/**
* Set a string as bsae64 (basic)
*
* @param string $script The code string
*
* @return string
* @since 3.2.0
*/
public function set(string $script): string;
}

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,59 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces;
/**
* Compiler Customcode Interface
*
* @since 3.2.0
*/
interface CustomcodeInterface
{
/**
* Update **ALL** dynamic values in a strings here
*
* @param string $string The content to check
* @param int $debug The switch to debug the update
* We can now at any time debug the
* dynamic build values if it gets broken
*
* @return string
* @since 3.2.0
*/
public function update(string $string, int $debug = 0): string;
/**
* Set the custom code data & can load it in to string
*
* @param string $string The content to check
* @param int $debug The switch to debug the update
* @param int|null $not The not switch
*
* @return string
* @since 3.2.0
*/
public function set(string $string, int $debug = 0, ?int $not = null): string;
/**
* Load the custom code from the system
*
* @param array|null $ids The custom code ides if known
* @param bool $setLang The set lang switch
* @param int $debug The switch to debug the update
*
* @return bool
* @since 3.2.0
*/
public function get(?array $ids = null, bool $setLang = true, $debug = 0): bool;
}

View File

@@ -9,7 +9,7 @@
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces;
namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces\Extension;
/**

View File

@@ -0,0 +1 @@
<html><body bgcolor="#FFFFFF"></body></html>

View File

@@ -0,0 +1,89 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces;
/**
* Compiler Language Interface
*
* @since 3.2.0
*/
interface LanguageInterface
{
/**
* Get the language string key
*
* @param string $string The plan text string (English)
*
* @return string The key language string (all uppercase)
* @since 3.2.0
*/
public function key($string): string;
/**
* check if the language string exist
*
* @param string $target The target area for the language string
* @param string|null $language The language key string
*
* @return bool
* @since 3.2.0
*/
public function exist(string $target, ?string $language = null): bool;
/**
* get the language string
*
* @param string $target The target area for the language string
* @param string|null $language The language key string
*
* @return Mixed The language string found or empty string if none is found
* @since 3.2.0
*/
public function get(string $target, string $language): string;
/**
* get target array
*
* @param string $target The target area for the language string
*
* @return array The target array or empty array if none is found
* @since 3.2.0
*/
public function getTarget(string $target): array;
/**
* set target array
*
* @param string $target The target area for the language string
* @param array|null $content The language content string
*
* @return void
* @since 3.2.0
*/
public function setTarget(string $target, ?array $content);
/**
* set the language content values to language content array
*
* @param string $target The target area for the language string
* @param string $language The language key string
* @param string $string The language string
* @param bool $addPrefix The switch to add langPrefix
*
* @return void
* @since 3.2.0
*/
public function set(string $target, string $language, string $string, bool $addPrefix = false);
}

View File

@@ -0,0 +1,72 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces;
/**
* Compiler Placeholder Interface
*
* @since 3.2.0
*/
interface PlaceholderInterface
{
/**
* Set a type of placeholder with set of values
*
* @param string $key The main string for placeholder key
* @param array $values The values to add
*
* @return void
* @since 3.2.0
*/
public function setType(string $key, array $values);
/**
* Remove a type of placeholder by main key
*
* @param string $key The main string for placeholder key
*
* @return void
* @since 3.2.0
*/
public function clearType(string $key);
/**
* Update the data with the placeholders
*
* @param string $data The actual data
* @param array $placeholder The placeholders
* @param int $action The action to use
*
* THE ACTION OPTIONS ARE
* 1 -> Just replace (default)
* 2 -> Check if data string has placeholders
* 3 -> Remove placeholders not in data string
*
* @return string
* @since 3.2.0
*/
public function update(string $data, array &$placeholder, int $action = 1): string;
/**
* return the placeholders for inserted and replaced code
*
* @param int $type The type of placement
* @param int|null $id The code id in the system
*
* @return array with start and end keys
* @since 3.2.0
*/
public function keys(int $type, ?int $id = null): array;
}

View File

@@ -0,0 +1,43 @@
<?php
/**
* @package Joomla.Component.Builder
*
* @created 30th April, 2015
* @author Llewellyn van der Merwe <https://dev.vdm.io>
* @git Joomla Component Builder <https://git.vdm.dev/joomla/Component-Builder>
* @copyright Copyright (C) 2015 Vast Development Method. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace VDM\Joomla\Componentbuilder\Compiler\Interfaces;
/**
* Compiler Power Interface
*
* @since 3.2.0
*/
interface PowerInterface
{
/**
* load all the powers linked to this component
*
* @param array $guids The global unique ids of the linked powers
*
* @return void
* @since 3.2.0
*/
public function load(array $guids);
/**
* Get a power
*
* @param string $guid The global unique id of the power
* @param int $build Force build switch (to override global switch)
*
* @return mixed
* @since 3.2.0
*/
public function get(string $guid, int $build = 0);
}