File tree Expand file tree Collapse file tree 6 files changed +9
-34
lines changed
Expand file tree Collapse file tree 6 files changed +9
-34
lines changed Original file line number Diff line number Diff line change 11# yocLib - Open Location Code (PHP)
22
3- This yocLibrary enables your project to read and write MPEGURL files in PHP.
3+ This yocLibrary enables your project to encode and decode Open Location Codes in PHP.
44
55## Status
66
7- [ ![ Build Status] ( https://travis-ci.com/yocto/yoclib-mpegurl -php.svg?branch=master )] ( https://travis-ci.com/yocto/yoclib-mpegurl -php )
7+ [ ![ Build Status] ( https://travis-ci.com/yocto/yoclib-openlocationcode -php.svg?branch=master )] ( https://travis-ci.com/yocto/yoclib-openlocationcode -php )
88
99## Installation
1010
11- ` composer require yocto/yoclib-mpegurl `
11+ ` composer require yocto/yoclib-openlocationcode `
1212
1313## Use
1414
15- Read:
16- ``` php
17- use YOCLIB\MPEGURL\MPEGURL;
18-
19- $fileContent = '';
20- $fileContent .= '#EXTM3U'."\r\n";
21- $fileContent .= '#EXTINF:123,The example file'."\r\n";
22- $fileContent .= '/home/user/test.mp3'."\r\n";
23-
24- $mpegurl = MPEGURL::read($fileContent);
25- ```
26-
27- Write:
28- ``` php
29- use YOCLIB\MPEGURL\MPEGURL;
30- use YOCLIB\MPEGURL\Lines\Location;
31- use YOCLIB\MPEGURL\Lines\Tags\EXTINF;
32- use YOCLIB\MPEGURL\Lines\Tags\EXTMxU;
33-
34- $mpegurl = new MPEGURL();
35- $mpegurl->addLine(new EXTMxU());
36- $mpegurl->addLine(new EXTINF('123,The example file'));
37- $mpegurl->addLine(new Location('/home/user/test.mp3'));
38-
39- $fileContent = MPEGURL::write($mpegurl);
40- ```
15+ TODO
Original file line number Diff line number Diff line change 11{
22 "name" : " yocto/yoclib-openlocationcode" ,
33 "type" : " library" ,
4- "description" : " This yocLibrary enables your project to read and write MPEGURL files in PHP." ,
4+ "description" : " This yocLibrary enables your project to encode and decode Open Location Codes in PHP." ,
55 "keywords" :[
66 " composer" ,
77 " openlocationcode" ,
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ class DecodingTest extends TestCase{
1616 public function setUp (): void {
1717 $ lines = TestUtils::getTestFileLines ('decoding.csv ' );
1818 foreach ($ lines AS $ line ){
19- if (str_starts_with ($ line ,'# ' ) ){
19+ if (substr ($ line , 0 , 1 )== '# ' ){
2020 continue ;
2121 }
2222 $ this ->testDataList [] = new DecodingTest_TestData ($ line );
Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ class EncodingTest extends TestCase{
1616 public function setUp (): void {
1717 $ lines = TestUtils::getTestFileLines ('encoding.csv ' );
1818 foreach ($ lines AS $ line ){
19- if (str_starts_with ($ line ,'# ' ) || strlen (trim ($ line ))==0 ){
19+ if (substr ($ line , 0 , 1 )== '# ' || strlen (trim ($ line ))==0 ){
2020 continue ;
2121 }
2222 $ this ->testDataList [] = new EncodingTest_TestData ($ line );
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ class ShorteningTest extends TestCase{
1414 public function setUp (): void {
1515 $ lines = TestUtils::getTestFileLines ('shortCodeTests.csv ' );
1616 foreach ($ lines AS $ line ){
17- if (str_starts_with ($ line ,'# ' ) ){
17+ if (substr ($ line , 0 , 1 )== '# ' ){
1818 continue ;
1919 }
2020 $ this ->testDataList [] = new ShorteningTest_TestData ($ line );
Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ class ValidityTest extends TestCase{
1414 public function setUp (): void {
1515 $ lines = TestUtils::getTestFileLines ('validityTests.csv ' );
1616 foreach ($ lines AS $ line ){
17- if (str_starts_with ($ line ,'# ' ) ){
17+ if (substr ($ line , 0 , 1 )== '# ' ){
1818 continue ;
1919 }
2020 $ this ->testDataList [] = new ValidityTest_TestData ($ line );
You can’t perform that action at this time.
0 commit comments