Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletions ClassExtended.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php

require_once("ClassPlayers.php");

class Defender extends Player {

public $strPosicion;
public static $strGeneralPosicion = "Defensa";

public function __construct($nombre, $posicion, $numero){
$this -> strPosicion = $posicion;
parent::__construct($nombre, $numero, $posicion);
}

public function perdidaAcabadaenGol(){
echo $this -> strNombre . "pierde el balón y termina en gol <br>";
}

public function pase(){
echo $this -> strNombre . "hace un buen pase <br>";
}

}


$newDefender = new Defender("Albert", "Defensa Central", 14);

$player -> perdida();
34 changes: 34 additions & 0 deletions ClassPlayers.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

class Player{

public $strNombre;
public $strPosicion;
public $intNumero;

public function __construct($nombre, $posicion, $numero){
$this -> strNombre = $nombre;
$this -> strPosicion = $posicion;
$this -> intNumero = $numero;
}

public function pase(){
echo $this -> strNombre . " pasa la pelota <br>";
}

public function chute(){
echo $this -> strNombre . " chuta la pelota <br>";
}

public function perdida(){
echo $this -> strNombre . " pierde la pelota <br>";
}

public function __destruct(){
echo "<br> The player is " . $this->strNombre;
}
}

$player = new Player("Neymar", "Delantero", 10);

$player -> perdida();
10 changes: 10 additions & 0 deletions abstractClass.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?

abstract class Scorers{

public $name;
public $goals;
abstract public function countGoals();
abstract public function rankingScorers();

}
15 changes: 15 additions & 0 deletions interface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

interface marketPlayers{

$name;

public function hacerOferta($name){
echo "Se ha enviado una oferta a " . $this -> $name;
}

public function fichar($name){
echo "Se ha fichado a " . $this -> $name;
}

}