Skip to content

Commit 42c0f58

Browse files
committed
#169 : PHPCS Fixes
1 parent 0b23e2c commit 42c0f58

File tree

7 files changed

+27
-28
lines changed

7 files changed

+27
-28
lines changed

src/PhpPresentation/Shape/Chart/Marker.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class Marker
3535
const SYMBOL_TRIANGLE = 'triangle';
3636
const SYMBOL_X = 'x';
3737

38-
static $SYMBOL = array(
38+
public static $arraySymbol = array(
3939
self::SYMBOL_CIRCLE,
4040
self::SYMBOL_DASH,
4141
self::SYMBOL_DIAMOND,

src/PhpPresentation/Shape/Chart/Series.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ public function setHashIndex($value)
535535
* @return mixed
536536
* @link http://php.net/manual/en/language.oop5.cloning.php
537537
*/
538-
function __clone()
538+
public function __clone()
539539
{
540540
$this->font = clone $this->font;
541541
$this->marker = clone $this->marker;

src/PhpPresentation/Shape/Chart/Type/AbstractType.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,12 @@ public function setData($value = array())
158158
* @return mixed
159159
* @link http://php.net/manual/en/language.oop5.cloning.php
160160
*/
161-
function __clone()
161+
public function __clone()
162162
{
163163
$arrayClone = array();
164164
foreach ($this->data as $itemSeries) {
165165
$arrayClone[] = clone $itemSeries;
166166
}
167167
$this->data = $arrayClone;
168168
}
169-
170169
}

src/PhpPresentation/Writer/PowerPoint2007/PptCharts.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2353,4 +2353,4 @@ protected function writeSeriesMarker(XMLWriter $objWriter, Chart\Marker $oMarker
23532353
$objWriter->endElement();
23542354
}
23552355
}
2356-
}
2356+
}

tests/PhpPresentation/Tests/Shape/Chart/MarkerTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public function testSymbol()
3838
{
3939
$object = new Marker();
4040

41-
$expected = array_rand(Marker::$SYMBOL);
41+
$expected = array_rand(Marker::$arraySymbol);
4242

4343
$this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Chart\\Marker', $object->setSymbol($expected));
4444
$this->assertEquals($expected, $object->getSymbol());

tests/PhpPresentation/Tests/Writer/ODPresentation/ChartsTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -458,9 +458,9 @@ public function testTypeLineSeriesOutline()
458458
$this->assertTrue($oXMLDoc->fileExists('Object 1/content.xml'));
459459
$this->assertTrue($oXMLDoc->elementExists($expectedElement, 'Object 1/content.xml'));
460460
$this->assertTrue($oXMLDoc->attributeElementExists($expectedElement, 'svg:stroke-width', 'Object 1/content.xml'));
461-
$this->assertEquals('0.079cm', $oXMLDoc->getElementAttribute($expectedElement, 'svg:stroke-width','Object 1/content.xml'));
461+
$this->assertEquals('0.079cm', $oXMLDoc->getElementAttribute($expectedElement, 'svg:stroke-width', 'Object 1/content.xml'));
462462
$this->assertTrue($oXMLDoc->attributeElementExists($expectedElement, 'svg:stroke-color', 'Object 1/content.xml'));
463-
$this->assertEquals('#4a7ebb', $oXMLDoc->getElementAttribute($expectedElement, 'svg:stroke-color','Object 1/content.xml'));
463+
$this->assertEquals('#4a7ebb', $oXMLDoc->getElementAttribute($expectedElement, 'svg:stroke-color', 'Object 1/content.xml'));
464464

465465
$oSeries->setOutline($oOutline);
466466
$oLine->setSeries(array($oSeries));
@@ -469,9 +469,9 @@ public function testTypeLineSeriesOutline()
469469
$this->assertTrue($oXMLDoc->fileExists('Object 1/content.xml'));
470470
$this->assertTrue($oXMLDoc->elementExists($expectedElement, 'Object 1/content.xml'));
471471
$this->assertTrue($oXMLDoc->attributeElementExists($expectedElement, 'svg:stroke-width', 'Object 1/content.xml'));
472-
$this->assertEquals($expectedWidthCm, $oXMLDoc->getElementAttribute($expectedElement, 'svg:stroke-width','Object 1/content.xml'));
472+
$this->assertEquals($expectedWidthCm, $oXMLDoc->getElementAttribute($expectedElement, 'svg:stroke-width', 'Object 1/content.xml'));
473473
$this->assertTrue($oXMLDoc->attributeElementExists($expectedElement, 'svg:stroke-color', 'Object 1/content.xml'));
474-
$this->assertEquals('#'.$oColor->getRGB(), $oXMLDoc->getElementAttribute($expectedElement, 'svg:stroke-color','Object 1/content.xml'));
474+
$this->assertEquals('#'.$oColor->getRGB(), $oXMLDoc->getElementAttribute($expectedElement, 'svg:stroke-color', 'Object 1/content.xml'));
475475
}
476476

477477
public function testTypeScatterMarker()
@@ -565,9 +565,9 @@ public function testTypeScatterSeriesOutline()
565565
$this->assertTrue($oXMLDoc->fileExists('Object 1/content.xml'));
566566
$this->assertTrue($oXMLDoc->elementExists($expectedElement, 'Object 1/content.xml'));
567567
$this->assertTrue($oXMLDoc->attributeElementExists($expectedElement, 'svg:stroke-width', 'Object 1/content.xml'));
568-
$this->assertEquals('0.079cm', $oXMLDoc->getElementAttribute($expectedElement, 'svg:stroke-width','Object 1/content.xml'));
568+
$this->assertEquals('0.079cm', $oXMLDoc->getElementAttribute($expectedElement, 'svg:stroke-width', 'Object 1/content.xml'));
569569
$this->assertTrue($oXMLDoc->attributeElementExists($expectedElement, 'svg:stroke-color', 'Object 1/content.xml'));
570-
$this->assertEquals('#4a7ebb', $oXMLDoc->getElementAttribute($expectedElement, 'svg:stroke-color','Object 1/content.xml'));
570+
$this->assertEquals('#4a7ebb', $oXMLDoc->getElementAttribute($expectedElement, 'svg:stroke-color', 'Object 1/content.xml'));
571571

572572
$oSeries->setOutline($oOutline);
573573
$oScatter->setSeries(array($oSeries));
@@ -576,8 +576,8 @@ public function testTypeScatterSeriesOutline()
576576
$this->assertTrue($oXMLDoc->fileExists('Object 1/content.xml'));
577577
$this->assertTrue($oXMLDoc->elementExists($expectedElement, 'Object 1/content.xml'));
578578
$this->assertTrue($oXMLDoc->attributeElementExists($expectedElement, 'svg:stroke-width', 'Object 1/content.xml'));
579-
$this->assertEquals($expectedWidthCm, $oXMLDoc->getElementAttribute($expectedElement, 'svg:stroke-width','Object 1/content.xml'));
579+
$this->assertEquals($expectedWidthCm, $oXMLDoc->getElementAttribute($expectedElement, 'svg:stroke-width', 'Object 1/content.xml'));
580580
$this->assertTrue($oXMLDoc->attributeElementExists($expectedElement, 'svg:stroke-color', 'Object 1/content.xml'));
581-
$this->assertEquals('#'.$oColor->getRGB(), $oXMLDoc->getElementAttribute($expectedElement, 'svg:stroke-color','Object 1/content.xml'));
581+
$this->assertEquals('#'.$oColor->getRGB(), $oXMLDoc->getElementAttribute($expectedElement, 'svg:stroke-color', 'Object 1/content.xml'));
582582
}
583583
}

tests/PhpPresentation/Tests/Writer/PowerPoint2007/PptChartsTest.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -287,10 +287,10 @@ public function testTypeLine()
287287
public function testTypeLineMarker()
288288
{
289289
do {
290-
$expectedSymbol = array_rand(Marker::$SYMBOL);
291-
} while($expectedSymbol == Marker::SYMBOL_NONE);
290+
$expectedSymbol = array_rand(Marker::$arraySymbol);
291+
} while ($expectedSymbol == Marker::SYMBOL_NONE);
292292
$expectedSize = rand(2, 72);
293-
$expectedElementSymbol = '/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser/c:marker/c:symbol';
293+
$expectedEltSymbol = '/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser/c:marker/c:symbol';
294294
$expectedElementSize = '/c:chartSpace/c:chart/c:plotArea/c:lineChart/c:ser/c:marker/c:size';
295295

296296
$oSlide = $this->oPresentation->getActiveSlide();
@@ -302,9 +302,9 @@ public function testTypeLineMarker()
302302
$oShape->getPlotArea()->setType($oLine);
303303

304304
$oXMLDoc = TestHelperDOCX::getDocument($this->oPresentation, 'PowerPoint2007');
305-
$this->assertTrue($oXMLDoc->elementExists($expectedElementSymbol, 'ppt/charts/'.$oShape->getIndexedFilename()));
305+
$this->assertTrue($oXMLDoc->elementExists($expectedEltSymbol, 'ppt/charts/'.$oShape->getIndexedFilename()));
306306
$this->assertTrue($oXMLDoc->elementExists($expectedElementSize, 'ppt/charts/'.$oShape->getIndexedFilename()));
307-
$this->assertEquals($expectedSymbol, $oXMLDoc->getElementAttribute($expectedElementSymbol, 'val', 'ppt/charts/'.$oShape->getIndexedFilename()));
307+
$this->assertEquals($expectedSymbol, $oXMLDoc->getElementAttribute($expectedEltSymbol, 'val', 'ppt/charts/'.$oShape->getIndexedFilename()));
308308
$this->assertEquals($expectedSize, $oXMLDoc->getElementAttribute($expectedElementSize, 'val', 'ppt/charts/'.$oShape->getIndexedFilename()));
309309

310310
$oSeries->getMarker()->setSize(1);
@@ -325,7 +325,7 @@ public function testTypeLineMarker()
325325
$oLine->setSeries(array($oSeries));
326326

327327
$oXMLDoc = TestHelperDOCX::getDocument($this->oPresentation, 'PowerPoint2007');
328-
$this->assertFalse($oXMLDoc->elementExists($expectedElementSymbol, 'ppt/charts/'.$oShape->getIndexedFilename()));
328+
$this->assertFalse($oXMLDoc->elementExists($expectedEltSymbol, 'ppt/charts/'.$oShape->getIndexedFilename()));
329329
$this->assertFalse($oXMLDoc->elementExists($expectedElementSize, 'ppt/charts/'.$oShape->getIndexedFilename()));
330330
}
331331

@@ -360,7 +360,7 @@ public function testTypeLineSeriesOutline()
360360
$oXMLDoc = TestHelperDOCX::getDocument($this->oPresentation, 'PowerPoint2007');
361361
$this->assertTrue($oXMLDoc->fileExists('ppt/charts/'.$oShape->getIndexedFilename()));
362362
$this->assertTrue($oXMLDoc->elementExists($expectedElement, 'ppt/charts/'.$oShape->getIndexedFilename()));
363-
$this->assertEquals($expectedWidthEmu, $oXMLDoc->getElementAttribute($expectedElement, 'w','ppt/charts/'.$oShape->getIndexedFilename()));
363+
$this->assertEquals($expectedWidthEmu, $oXMLDoc->getElementAttribute($expectedElement, 'w', 'ppt/charts/'.$oShape->getIndexedFilename()));
364364
$this->assertTrue($oXMLDoc->elementExists($expectedElement.'/a:solidFill', 'ppt/charts/'.$oShape->getIndexedFilename()));
365365
}
366366

@@ -539,10 +539,10 @@ public function testTypeScatter()
539539
public function testTypeScatterMarker()
540540
{
541541
do {
542-
$expectedSymbol = array_rand(Marker::$SYMBOL);
543-
} while($expectedSymbol == Marker::SYMBOL_NONE);
542+
$expectedSymbol = array_rand(Marker::$arraySymbol);
543+
} while ($expectedSymbol == Marker::SYMBOL_NONE);
544544
$expectedSize = rand(2, 72);
545-
$expectedElementSymbol = '/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:marker/c:symbol';
545+
$expectedEltSymbol = '/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:marker/c:symbol';
546546
$expectedElementSize = '/c:chartSpace/c:chart/c:plotArea/c:scatterChart/c:ser/c:marker/c:size';
547547

548548
$oSlide = $this->oPresentation->getActiveSlide();
@@ -554,9 +554,9 @@ public function testTypeScatterMarker()
554554
$oShape->getPlotArea()->setType($oScatter);
555555

556556
$oXMLDoc = TestHelperDOCX::getDocument($this->oPresentation, 'PowerPoint2007');
557-
$this->assertTrue($oXMLDoc->elementExists($expectedElementSymbol, 'ppt/charts/'.$oShape->getIndexedFilename()));
557+
$this->assertTrue($oXMLDoc->elementExists($expectedEltSymbol, 'ppt/charts/'.$oShape->getIndexedFilename()));
558558
$this->assertTrue($oXMLDoc->elementExists($expectedElementSize, 'ppt/charts/'.$oShape->getIndexedFilename()));
559-
$this->assertEquals($expectedSymbol, $oXMLDoc->getElementAttribute($expectedElementSymbol, 'val', 'ppt/charts/'.$oShape->getIndexedFilename()));
559+
$this->assertEquals($expectedSymbol, $oXMLDoc->getElementAttribute($expectedEltSymbol, 'val', 'ppt/charts/'.$oShape->getIndexedFilename()));
560560
$this->assertEquals($expectedSize, $oXMLDoc->getElementAttribute($expectedElementSize, 'val', 'ppt/charts/'.$oShape->getIndexedFilename()));
561561

562562
$oSeries->getMarker()->setSize(1);
@@ -577,7 +577,7 @@ public function testTypeScatterMarker()
577577
$oScatter->setSeries(array($oSeries));
578578

579579
$oXMLDoc = TestHelperDOCX::getDocument($this->oPresentation, 'PowerPoint2007');
580-
$this->assertFalse($oXMLDoc->elementExists($expectedElementSymbol, 'ppt/charts/'.$oShape->getIndexedFilename()));
580+
$this->assertFalse($oXMLDoc->elementExists($expectedEltSymbol, 'ppt/charts/'.$oShape->getIndexedFilename()));
581581
$this->assertFalse($oXMLDoc->elementExists($expectedElementSize, 'ppt/charts/'.$oShape->getIndexedFilename()));
582582
}
583583

@@ -612,7 +612,7 @@ public function testTypeScatterSeriesOutline()
612612
$oXMLDoc = TestHelperDOCX::getDocument($this->oPresentation, 'PowerPoint2007');
613613
$this->assertTrue($oXMLDoc->fileExists('ppt/charts/'.$oShape->getIndexedFilename()));
614614
$this->assertTrue($oXMLDoc->elementExists($expectedElement, 'ppt/charts/'.$oShape->getIndexedFilename()));
615-
$this->assertEquals($expectedWidthEmu, $oXMLDoc->getElementAttribute($expectedElement, 'w','ppt/charts/'.$oShape->getIndexedFilename()));
615+
$this->assertEquals($expectedWidthEmu, $oXMLDoc->getElementAttribute($expectedElement, 'w', 'ppt/charts/'.$oShape->getIndexedFilename()));
616616
$this->assertTrue($oXMLDoc->elementExists($expectedElement.'/a:solidFill', 'ppt/charts/'.$oShape->getIndexedFilename()));
617617
}
618618

0 commit comments

Comments
 (0)