It took me some minutes to figure this out. First I checked my "php.ini" in "/etc/php". Then, I checked it multiple times and the error is not gone. Afterwards, a browsing on the web pointed me the glowing path in the dark ;-).
First you have to know is the fact, that composer is having its own "php.ini". It is stored in "/usr/share/php-composer/php.ini". All you have to do is to add "extension=iconv.so" in the "[PHP]" section and thats it. Happy composing :-)
By using this component, you are able to use type hints also for basic data types.
This component includes class definitions for php basic data types like:
Boolean
Floating point
Integer
String
Numeric
Features
Enables type hints for basic php types
Types shipped with useful methods
Are comparable with native php types by using "=="
Provides generic type casting by implemented "toString()" methods (and so on)
Usage
Example
/**
* Class with type hint for string
*
* @author stev leibelt
* @since 2013-08-04
*/
class MyClass
{
/**
* @var array
* @author stev leibelt
* @since 2013-08-04
*/
private $strings = array();
/**
* Super cool method with type hint for string
*
* @author stev leibelt
* @since 2013-08-04
*/
public function addString(\Net\Bazzline\Component\DataType\String $string)
{
$this->strings[] = $string;
return $this;
}
}
$myString = new \Net\Bazzline\Component\DataType\String('super cool test string');
$myClass = new MyClass();
$myClass->addString($myString);
Hints
Extend provided types with classes in own namespace.
If you add a super cool method to your type, push it and be a part of the development team
I started developing this component because of the many casts i have to do while dealing with php's basic data types.
As general, i searched the web for existing and easy to use components but could not find them. If you find one, please tell me.
Last but not least SplTypes are still experimental.
I've finished writing unit tests for this component a few minutes ago so as the a beloved meme would say "things are getting pretty serious" ;-). It is possible i will tag the version "1.0.0" very soon.
What is this component for and where do i get it?
This component is considered as a starting point for creating question and answer test cases. Each test case has one question and one answer type. The current available types of answers are "single answer", "multiple answer" and "free text answer". All three types are using the same interface, so you can use them everywhere. You have to enter an answer to an answer (quite surprising right? ;-)) and the answer has the ability to tell you if your answer was the right one or how correct your current answer is.
The ideal wish is, that a lot of people are writing test cases for different subjects and you just simple use this component and the subjects to create your application or environment to use this test cases to, well, test people or yourself.
You can get the TestCase on github.com or via packagist.
A suite is also there to arrange multiple test cases under one subject. Since this component is using the Configuration Converter, everything can be written down as "YAML", "JSON" or "PHPArray". To illustrate this, you can write a "Suite.yaml" that points to a "TestCase.php" that is using a "Question.php" and a "Answer.yaml". The available factories can handle that if you want to.
The component itself is currently really basic so do not expect that finished "save the world" thing. But the test case stuff is started and truly open source.