Skip to content

Commit 5cfa50f

Browse files
committed
Removed deprecated methods
1 parent 31ab338 commit 5cfa50f

File tree

7 files changed

+19
-134
lines changed

7 files changed

+19
-134
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,19 @@
11
# Changelog
2+
## 0.5.0 - Not released
3+
4+
### Features
5+
6+
### Bugfix
7+
8+
### Miscellaneous
9+
- PhpOffice\PhpPowerpoint\Style\Font::setStriketrough has been removed : Use setStrikethrough
10+
- PhpOffice\PhpPowerpoint\AbstractShape::getSlide has been removed
11+
- PhpOffice\PhpPowerpoint\AbstractShape::setSlide has been removed
12+
- PhpOffice\PhpPowerpoint\DocumentLayout::getLayoutXmilli has been removed : getCX(DocumentLayout::UNIT_MILLIMETER)
13+
- PhpOffice\PhpPowerpoint\DocumentLayout::getLayoutYmilli has been removed : getCY(DocumentLayout::UNIT_MILLIMETER)
14+
- PhpOffice\PhpPowerpoint\DocumentLayout::setLayoutXmilli has been removed : setCX(DocumentLayout::UNIT_MILLIMETER)
15+
- PhpOffice\PhpPowerpoint\DocumentLayout::setLayoutYmilli has been removed : setCY(DocumentLayout::UNIT_MILLIMETER)
16+
217
## 0.4.0 - 2015-07-07
318

419
### Features

src/PhpPowerpoint/AbstractShape.php

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -180,31 +180,6 @@ public function setContainer(ShapeContainerInterface $pValue = null, $pOverrideO
180180
return $this;
181181
}
182182

183-
/**
184-
* Get Slide
185-
*
186-
* @return \PhpOffice\PhpPowerpoint\Container
187-
* @deprecated
188-
*/
189-
public function getSlide()
190-
{
191-
return $this->getContainer();
192-
}
193-
194-
/**
195-
* Set Slide
196-
*
197-
* @param \PhpOffice\PhpPowerpoint\Slide $pValue
198-
* @param bool $pOverrideOld If a Slide has already been assigned, overwrite it and remove image from old Slide?
199-
* @throws \Exception
200-
* @return self
201-
* @deprecated
202-
*/
203-
public function setSlide(Slide $pValue = null, $pOverrideOld = false)
204-
{
205-
return $this->setContainer($pValue, $pOverrideOld);
206-
}
207-
208183
/**
209184
* Get OffsetX
210185
*

src/PhpPowerpoint/DocumentLayout.php

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -244,56 +244,4 @@ protected function convertUnit($value, $fromUnit, $toUnit)
244244
}
245245
return $value;
246246
}
247-
248-
/**
249-
* Get Document Layout in millimeters
250-
*
251-
* @return integer
252-
* @deprecated 0.4.0 getCX(DocumentLayout::UNIT_MILLIMETER)
253-
*/
254-
public function getLayoutXmilli()
255-
{
256-
return $this->dimensionX / 36000;
257-
}
258-
259-
/**
260-
* Get Document Layout in millimeters
261-
*
262-
* @return integer
263-
* @deprecated 0.4.0 getCY(DocumentLayout::UNIT_MILLIMETER)
264-
*/
265-
public function getLayoutYmilli()
266-
{
267-
return $this->dimensionY / 36000;
268-
}
269-
270-
/**
271-
* Set Document Layout in millimeters
272-
*
273-
* @param integer $pValue Layout width
274-
* @return \PhpOffice\PhpPowerpoint\DocumentLayout
275-
* @deprecated 0.4.0 setCY($pValue, DocumentLayout::UNIT_MILLIMETER)
276-
*/
277-
public function setLayoutXmilli($pValue)
278-
{
279-
$this->dimensionX = $pValue * 36000;
280-
$this->layout = self::LAYOUT_CUSTOM;
281-
282-
return $this;
283-
}
284-
285-
/**
286-
* Set Document Layout in millimeters
287-
*
288-
* @param integer $pValue Layout height
289-
* @return \PhpOffice\PhpPowerpoint\DocumentLayout
290-
* @deprecated 0.4.0 setCY($pValue, DocumentLayout::UNIT_MILLIMETER)
291-
*/
292-
public function setLayoutYmilli($pValue)
293-
{
294-
$this->dimensionY = $pValue * 36000;
295-
$this->layout = self::LAYOUT_CUSTOM;
296-
297-
return $this;
298-
}
299247
}

src/PhpPowerpoint/Style/Font.php

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -315,18 +315,6 @@ public function setUnderline($pValue = self::UNDERLINE_NONE)
315315
return $this;
316316
}
317317

318-
/**
319-
* Set Striketrough
320-
*
321-
* @deprecated Use setStrikethrough() instead.
322-
* @param boolean $pValue
323-
* @return \PhpOffice\PhpPowerpoint\Style\Font
324-
*/
325-
public function setStriketrough($pValue = false)
326-
{
327-
return $this->setStrikethrough($pValue);
328-
}
329-
330318
/**
331319
* Get Strikethrough
332320
*

tests/PhpPowerpoint/Tests/AbstractShapeTest.php

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ public function testConstruct()
3636
{
3737
$object = new RichText();
3838

39-
$this->assertNull($object->getSlide());
4039
$this->assertEquals(0, $object->getOffsetX());
4140
$this->assertEquals(0, $object->getOffsetY());
4241
$this->assertEquals(0, $object->getHeight());
@@ -126,36 +125,6 @@ public function testShadow()
126125
$this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Shadow', $object->getShadow());
127126
}
128127

129-
public function testSlide()
130-
{
131-
$object = new RichText();
132-
$oSlide1 = new Slide();
133-
$oSlide2 = new Slide();
134-
$oSlide3 = new Slide();
135-
136-
$this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\AbstractShape', $object->setSlide());
137-
$this->assertNull($object->getSlide());
138-
$this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\AbstractShape', $object->setSlide($oSlide1, true));
139-
$this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide', $object->getSlide());
140-
$this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\AbstractShape', $object->setSlide($oSlide2, true));
141-
$this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide', $object->getSlide());
142-
$this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\AbstractShape', $object->setSlide($oSlide3, true));
143-
$this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide', $object->getSlide());
144-
$this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\AbstractShape', $object->setSlide($oSlide3, true));
145-
$this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Slide', $object->getSlide());
146-
}
147-
148-
/**
149-
* @expectedException \Exception
150-
* @expectedExceptionMessage A \PhpOffice\PhpPowerpoint\ShapeContainerInterface has already been assigned. Shapes can only exist on one \PhpOffice\PhpPowerpoint\ShapeContainerInterface.
151-
*/
152-
public function testSlideException()
153-
{
154-
$object = new RichText();
155-
$object->setSlide(new Slide());
156-
$object->setSlide(new Slide());
157-
}
158-
159128
public function testWidth()
160129
{
161130
$object = new RichText();

tests/PhpPowerpoint/Tests/DocumentLayoutTest.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ public function testConstruct()
3636
$this->assertEquals('screen4x3', $object->getDocumentLayout());
3737
$this->assertEquals(9144000, $object->getCX());
3838
$this->assertEquals(6858000, $object->getCY());
39-
$this->assertEquals(9144000 / 36000, $object->getLayoutXmilli());
40-
$this->assertEquals(6858000 / 36000, $object->getLayoutYmilli());
4139
}
4240

4341
/**
@@ -70,14 +68,10 @@ public function testCX()
7068
$this->assertEquals($value, $object->getCX(DocumentLayout::UNIT_INCH));
7169
$this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setCX($value, DocumentLayout::UNIT_MILLIMETER));
7270
$this->assertEquals($value, $object->getCX(DocumentLayout::UNIT_MILLIMETER));
73-
$this->assertEquals($value, $object->getLayoutXmilli());
7471
$this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setCX($value, DocumentLayout::UNIT_POINT));
7572
$this->assertEquals($value, $object->getCX(DocumentLayout::UNIT_POINT));
7673
$this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setCX($value, DocumentLayout::UNIT_PIXEL));
7774
$this->assertEquals($value, $object->getCX(DocumentLayout::UNIT_PIXEL));
78-
$this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setLayoutXmilli($value));
79-
$this->assertEquals($value, $object->getCX(DocumentLayout::UNIT_MILLIMETER));
80-
$this->assertEquals($value, $object->getLayoutXmilli());
8175
}
8276

8377
public function testCY()
@@ -94,13 +88,9 @@ public function testCY()
9488
$this->assertEquals($value, $object->getCY(DocumentLayout::UNIT_INCH));
9589
$this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setCY($value, DocumentLayout::UNIT_MILLIMETER));
9690
$this->assertEquals($value, $object->getCY(DocumentLayout::UNIT_MILLIMETER));
97-
$this->assertEquals($value, $object->getLayoutYmilli());
9891
$this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setCY($value, DocumentLayout::UNIT_POINT));
9992
$this->assertEquals($value, $object->getCY(DocumentLayout::UNIT_POINT));
10093
$this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setCY($value, DocumentLayout::UNIT_PIXEL));
10194
$this->assertEquals($value, $object->getCY(DocumentLayout::UNIT_PIXEL));
102-
$this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\DocumentLayout', $object->setLayoutYmilli($value));
103-
$this->assertEquals($value, $object->getCY(DocumentLayout::UNIT_MILLIMETER));
104-
$this->assertEquals($value, $object->getLayoutYmilli());
10595
}
10696
}

tests/PhpPowerpoint/Tests/Style/FontTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,13 +139,13 @@ public function testSetIsItalic()
139139
public function testSetIsStriketrough()
140140
{
141141
$object = new Font();
142-
$this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setStriketrough());
142+
$this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setStrikethrough());
143143
$this->assertFalse($object->isStrikethrough());
144-
$this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setStriketrough(''));
144+
$this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setStrikethrough(''));
145145
$this->assertFalse($object->isStrikethrough());
146-
$this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setStriketrough(false));
146+
$this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setStrikethrough(false));
147147
$this->assertFalse($object->isStrikethrough());
148-
$this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setStriketrough(true));
148+
$this->assertInstanceOf('PhpOffice\\PhpPowerpoint\\Style\\Font', $object->setStrikethrough(true));
149149
$this->assertTrue($object->isStrikethrough());
150150
}
151151

0 commit comments

Comments
 (0)