Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
W
webbasics
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Taddeüs Kroes
webbasics
Commits
7967464b
Commit
7967464b
authored
Jul 14, 2012
by
Taddeus Kroes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cleanup.
parent
caa0fc0d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
+7
-8
base.php
base.php
+7
-2
tests/test_autoloader.php
tests/test_autoloader.php
+0
-6
No files found.
base.php
View file @
7967464b
...
@@ -56,10 +56,15 @@ class FileNotFoundError extends \RuntimeException {
...
@@ -56,10 +56,15 @@ class FileNotFoundError extends \RuntimeException {
}
}
/**
/**
* Format a string of the form 'foo %(bar)' with given parameters like array('bar' => 'some value').
* Format a string using parameters in an associative array.
*
* <code>
* echo asprintf('foo %(bar)', array('bar' => 'baz')); // prints 'foo baz'
* </code>
*
*
* @param string $format The string to format.
* @param string $format The string to format.
* @param array $params An associative array with parameters that are used in the format.
* @param array $params An associative array with parameters that are used in $format.
* @package BasicWeb
*/
*/
function
asprintf
(
$format
,
array
$params
)
{
function
asprintf
(
$format
,
array
$params
)
{
return
preg_replace_callback
(
return
preg_replace_callback
(
...
...
tests/test_autoloader.php
View file @
7967464b
...
@@ -6,16 +6,10 @@ use BasicWeb\Autoloader;
...
@@ -6,16 +6,10 @@ use BasicWeb\Autoloader;
define
(
'PATH'
,
'tests/_files/'
);
define
(
'PATH'
,
'tests/_files/'
);
class
AutoloaderTest
extends
PHPUnit_Framework_TestCase
{
class
AutoloaderTest
extends
PHPUnit_Framework_TestCase
{
var
$autoloader
;
function
setUp
()
{
function
setUp
()
{
$this
->
autoloader
=
new
Autoloader
(
PATH
);
$this
->
autoloader
=
new
Autoloader
(
PATH
);
}
}
function
tearDown
()
{
unset
(
$this
->
autoloader
);
}
function
test_path_with_slash
()
{
function
test_path_with_slash
()
{
$this
->
assertEquals
(
Autoloader
::
path_with_slash
(
'dirname'
),
'dirname/'
);
$this
->
assertEquals
(
Autoloader
::
path_with_slash
(
'dirname'
),
'dirname/'
);
$this
->
assertEquals
(
Autoloader
::
path_with_slash
(
'dirname/'
),
'dirname/'
);
$this
->
assertEquals
(
Autoloader
::
path_with_slash
(
'dirname/'
),
'dirname/'
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment