Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
symfony_2504
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Lech Sawoń
symfony_2504
Commits
1fc7c797
Commit
1fc7c797
authored
Oct 26, 2021
by
Lech Sawon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
type hinting
parent
0c16a6c5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
30 deletions
+49
-30
TEst.php
src/Controller/TEst.php
+0
-11
Reservation.php
src/Entity/Reservation.php
+29
-13
Room.php
src/Entity/Room.php
+20
-6
No files found.
src/Controller/TEst.php
deleted
100644 → 0
View file @
0c16a6c5
<?php
declare
(
strict_types
=
1
);
namespace
App\Controller
;
final
class
TEst
{
}
src/Entity/Reservation.php
View file @
1fc7c797
...
@@ -15,7 +15,7 @@ class Reservation
...
@@ -15,7 +15,7 @@ class Reservation
* @ORM\GeneratedValue
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @ORM\Column(type="integer")
*/
*/
private
$id
;
private
int
$id
;
/**
/**
* @ORM\ManyToOne(targetEntity="Room")
* @ORM\ManyToOne(targetEntity="Room")
...
@@ -26,18 +26,28 @@ class Reservation
...
@@ -26,18 +26,28 @@ class Reservation
/**
/**
* @ORM\Column(type="datetime")
* @ORM\Column(type="datetime")
*/
*/
private
$dateFrom
;
private
\DateTime
$dateFrom
;
/**
/**
* @ORM\Column(type="datetime")
* @ORM\Column(type="datetime")
*/
*/
private
$dateEnd
;
private
\DateTime
$dateEnd
;
public
function
getId
()
:
?
int
public
function
getId
()
:
int
{
{
return
$this
->
id
;
return
$this
->
id
;
}
}
/**
* @param int $id
* @return Reservation
*/
public
function
setId
(
int
$id
)
:
Reservation
{
$this
->
id
=
$id
;
return
$this
;
}
public
function
getRoom
()
:
Room
public
function
getRoom
()
:
Room
{
{
return
$this
->
room
;
return
$this
->
room
;
...
@@ -45,35 +55,41 @@ class Reservation
...
@@ -45,35 +55,41 @@ class Reservation
/**
/**
* @param Room $room
* @param Room $room
* @return Reservation
*/
*/
public
function
setRoom
(
Room
$room
)
:
void
public
function
setRoom
(
Room
$room
)
:
Reservation
{
{
$this
->
room
=
$room
;
$this
->
room
=
$room
;
return
$this
;
}
}
public
function
getDateFrom
()
:
\DateTime
public
function
getDateFrom
()
:
?
\DateTimeInterface
{
{
return
$this
->
dateFrom
;
return
$this
->
dateFrom
;
}
}
public
function
setDateFrom
(
\DateTimeInterface
$dateFrom
)
:
self
/**
* @param \DateTime $dateFrom
* @return Reservation
*/
public
function
setDateFrom
(
\DateTime
$dateFrom
)
:
Reservation
{
{
$this
->
dateFrom
=
$dateFrom
;
$this
->
dateFrom
=
$dateFrom
;
return
$this
;
return
$this
;
}
}
public
function
getDateEnd
()
:
?
\DateTimeInterfac
e
public
function
getDateEnd
()
:
\DateTim
e
{
{
return
$this
->
dateEnd
;
return
$this
->
dateEnd
;
}
}
public
function
setDateEnd
(
\DateTimeInterface
$dateEnd
)
:
self
/**
* @param \DateTime $dateEnd
* @return Reservation
*/
public
function
setDateEnd
(
\DateTime
$dateEnd
)
:
Reservation
{
{
$this
->
dateEnd
=
$dateEnd
;
$this
->
dateEnd
=
$dateEnd
;
return
$this
;
return
$this
;
}
}
}
}
src/Entity/Room.php
View file @
1fc7c797
...
@@ -15,30 +15,44 @@ class Room
...
@@ -15,30 +15,44 @@ class Room
* @ORM\GeneratedValue
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
* @ORM\Column(type="integer")
*/
*/
private
$id
;
private
int
$id
;
/**
/**
* @ORM\Column(type="string", length=255)
* @ORM\Column(type="string", length=255)
*/
*/
private
$name
;
private
string
$name
;
public
function
getId
()
:
?
int
public
function
getId
()
:
int
{
{
return
$this
->
id
;
return
$this
->
id
;
}
}
public
function
getName
()
:
?
string
/**
* @param int $id
* @return Room
*/
public
function
setId
(
int
$id
)
:
Room
{
$this
->
id
=
$id
;
return
$this
;
}
public
function
getName
()
:
string
{
{
return
$this
->
name
;
return
$this
->
name
;
}
}
public
function
setName
(
string
$name
)
:
self
/**
* @param string $name
* @return Room
*/
public
function
setName
(
string
$name
)
:
Room
{
{
$this
->
name
=
$name
;
$this
->
name
=
$name
;
return
$this
;
return
$this
;
}
}
public
function
__toString
()
:
string
public
function
__toString
()
:
string
{
{
return
$this
->
getName
();
return
$this
->
getName
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment