Page Menu
Home
Code
Search
Configure Global Search
Log In
Files
F209365
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
7 KB
Subscribers
None
View Options
diff --git a/dev/tests/Engines/Templates/Smarty/Plugins/RomanizeModifierTest.php b/dev/tests/Engines/Templates/Smarty/Plugins/RomanizeModifierTest.php
index 4523d83..215baa6 100644
--- a/dev/tests/Engines/Templates/Smarty/Plugins/RomanizeModifierTest.php
+++ b/dev/tests/Engines/Templates/Smarty/Plugins/RomanizeModifierTest.php
@@ -1,28 +1,28 @@
<?php
declare(strict_types=1);
namespace Zed\Tests\Engines\Templates\Smarty\Plugins;
class RomanizeModifierTest extends SmartyPluginTestCase {
- public function setUp () {
+ public function setUp () : void {
$this->requirePlugin('modifier', 'romanize');
}
public function testPluginWithCorrectValueAsInteger () {
$this->assertEquals('iv', smarty_modifier_romanize(4));
}
public function testPluginWithCorrectValueAsString () {
$this->assertEquals('iv', smarty_modifier_romanize('4'));
}
public function testPluginWithNonNumeric () {
$this->assertEquals('quux', smarty_modifier_romanize('quux'));
}
public function testPluginWithNegativeNumber () {
$this->assertSame('-4', smarty_modifier_romanize(-4));
}
}
diff --git a/includes/story/hook_demo.php b/includes/story/hook_demo.php
index 43177f9..dcf7142 100644
--- a/includes/story/hook_demo.php
+++ b/includes/story/hook_demo.php
@@ -1,76 +1,76 @@
<?php
/**
* Story hook class: example code
*
* Zed. The immensity of stars. The HyperShip. The people.
*
* (c) 2010, Dereckson, some rights reserved.
* Released under BSD license.
*
* This class illustrates how to use the StoryHook class.
*
* @package Zed
* @subpackage Story
* @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
* @copyright 2010 Sébastien Santoro aka Dereckson
* @license http://www.opensource.org/licenses/bsd-license.php BSD
* @version 0.1
* @link http://scherzo.dereckson.be/doc/zed
* @link http://zed.dereckson.be/
* @filesource
*/
$class = "DemoStoryHook";
/**
* Story hook demo class
*/
class DemoStoryHook extends StoryHook {
/**
* Initializes resources
*
* @see StoryHook::initialize
*
* The initialize method is called after the constructor and is mandatory,
* even if you've nothing to initialize, as it's an abstract method.
*/
function initialize () {}
/**
* Updates the current section description.
*
+ * @param string $description the description to update
* @see StoryHook::update_description
*
- * @param string $description the description to update
*/
- function update_description (&$description) {
+ function update_description (string &$description) {
//Performs the rot13 transform of the current description
$description = str_rot13($description);
//Appends a string to the current description
$description .= "\n\nWazzzzzzzzzzzzzzzzaaaaaaaaaaaaaaaaaaaaaa";
}
/**
* Updates the current section choices
*
- * @see StoryHook::get_choices_links
- *
* @param Array $links the section links
+ *@see StoryHook::get_choices_links
+ *
*/
- function get_choices_links (&$links) {
+ function get_choices_links (array &$links) {
//Adds a link to /push
$links[] = [lang_get("PushMessage"), get_url('push')];
}
/**
* Adds content after our story content block
*
* @see StoryHook::add_html
*/
function add_html () {
//Adds a html block
return '<div class="black">Lorem ipsum dolor</div>';
}
}
diff --git a/includes/story/hook_spatioport.php b/includes/story/hook_spatioport.php
index 3e1f3cd..73d698c 100644
--- a/includes/story/hook_spatioport.php
+++ b/includes/story/hook_spatioport.php
@@ -1,134 +1,134 @@
<?php
/**
* Story hook class :: spatioport
*
* Zed. The immensity of stars. The HyperShip. The people.
*
* (c) 2010, Dereckson, some rights reserved.
* Released under BSD license.
*
* This class allows to hook spatioport content to a story.
*
* It lists the ship inside the spatioport and in the surrounding space.
*
* @package Zed
* @subpackage Story
* @author Sébastien Santoro aka Dereckson <dereckson@espace-win.org>
* @copyright 2010 Sébastien Santoro aka Dereckson
* @license http://www.opensource.org/licenses/bsd-license.php BSD
* @version 0.1
* @link http://scherzo.dereckson.be/doc/zed
* @link http://zed.dereckson.be/
* @filesource
*
* @todo Adds spatioport services, like ship repair & co
* @todo Adds a map of the sky, with ship around
* @todo Consider to use the Port class instead and to move get_ships methods there.
*/
use Zed\Models\Geo\Location;
use Zed\Models\Objects\Ship;
$class = 'SpatioportStoryHook';
/**
* Spatioport story hook class
*/
class SpatioportStoryHook extends StoryHook {
/**
* The spatioport location
*
* @var Location
*/
public $location;
/**
* The spatioport global location
*
* @var string
*/
public $location_global;
/**
* The spatioport local location
*
* @var string
*/
public $location_local;
/**
* Updates and gets the current section choices
*
* @param Array $links The story links
*/
- function get_choices_links (&$links) {
+ function get_choices_links (array &$links) {
//$links[] = array('Examiner les vaisseaux', get_url('port','ships'));
}
/**
* Initializes instance location properties
*/
function initialize () {
$this->location_global = $this->perso->location_global;
$this->location_local = $this->section->location_local;
$this->location = new Location($db, $this->location_global, $this->location_local);
}
/**
* Appends ship list to the story description
*/
function add_content () {
$ships = $this->get_ships();
if (count($ships)) {
echo "\n<h2>Ships</h2>";
echo "<p>Amongst the ships are at the spatioport:</p>";
echo "\n<ul>";
foreach ($ships as $ship) {
$url = get_url('ship', $ship);
echo "\n\t<li><a href=\"$url\">$ship->name</a></li>";
}
echo "\n</ul>";
}
$ships = $this->get_ships_in_space();
if (count($ships)) {
echo "\n<h2>In orbit</h2>";
$place = (string)$this->location->body;
echo "<p>Those ships are in space around $place:</p>";
echo "\n<ul>";
foreach ($ships as $ship) {
$url = get_url('ship', $ship);
echo "\n\t<li><a href=\"$url\">$ship->name</a></li>";
}
echo "\n</ul>";
}
}
/**
* Get ships in the spatioports
*
* @param string $location_global global location
* @param string $location_local local location
* @return array The ships in the spatioport
*/
private function get_ships () {
global $db;
return Ship::get_ships_at($db, $this->location_global, $this->location_local);
}
/**
* Get ships in the space surrounding the spatioport
*
* @param string $location_global global location
* @param string $location_local local location
* @return array The ships in the space around the spatioport
*/
private function get_ships_in_space () {
global $db;
return Ship::get_ships_at($db, $this->location_global, null);
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Nov 3, 23:53 (3 w, 5 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
20762
Default Alt Text
(7 KB)
Attached To
rZED Zed
Event Timeline
Log In to Comment